Irony, in terms of literature, is when the audience knows something that the characters or the narrator of the story do not. This knowledge creates emotion in the audience, either by raising the level of suspense or feeling of drama, or perhaps by making them laugh. An example would be Shakespeare’s Romeo and Juliet: the audience knows that Romeo is just sleeping, not dead, which makes Juliet’s suicide all the more horrific.
In games, irony can be used in a similar fashion in cut-scenes and dialogue. A good example of this is Portal 2. Presuming the player has played the first game, Portal 2 sets up a lot of drama and humor based upon audience knowledge. When Wheatley is telling Chell what happened in the first game, the audience will obviously recognize that Chell – and the player – already knows these things. She was there!