In a play, dramatic irony occurs when

a struggle is repeated in the course of the plot
the audience knows something that a character onstage does not know
a suspenseful plot keeps the audience guessing about future events
a character grows or changes as events unfold