Billy Budd is an extremely ironic novella, and Melville uses dramatic irony to create tension in the story. When Budd is accused of mutiny by Claggart, the reader is aware that Billy wasn't trying to organize a mutiny, even though Captain Vere and other members of the crew are unaware. This difference in knowledge between the reader and characters of the story is an example of dramatic irony.
Throughout the novella, readers are aware of Captain Vere's internal moral dilemma as he presides over Billy's trial. Vere is torn between his belief in Billy's innocence (which the reader knows to be true) and his duty to uphold naval law. The audience is aware of the inner turmoil and the moral complexities Vere deals with, while other characters, including Billy and the rest of the crew, do not. This creates dramatic tension for the reader.
As the story progresses, the audience becomes increasingly aware of the grim fate that awaits Billy, while Billy himself remains mostly oblivious. In doing so, Melville suggests that Billy's inherent innocence and goodness is ultimately futile in the face of a rigid justice system like the one found on the ship. All in all, Melville uses irony to underscore the complexities of human nature and justice, as well as the conflict that can occur between individual morality and institutional regulations.