A reader might know things that the characters do not.
This creates suspense because the reader is aware of potential dangers or plot twists that the characters have yet to discover, leading to tension as they anticipate the characters' reactions when they eventually find out. At the same time, it can also generate humor, especially if the reader knows a humorous situation is about to unfold that the characters remain oblivious to. This dramatic irony allows the audience to experience both excitement and amusement simultaneously.