Irony is, generally, the difference between what you expect to happen and what really happens. In the case of Chaucer's "The Pardoner's Tale," from The Canterbury Tales, dramatic irony is used.
Dramatic irony (the most important type for literature) involves a situation in a narrative in which the reader knows something about present or future circumstances that the character does not know. In that situation, the character acts in a way we recognize to be grossly inappropriate to the actual circumstances, or the character expects the opposite of what the reader knows that fate holds in store, or the character anticipates a particular outcome that unfolds itself in an unintentional way.
Interestingly, the Pardoner is a servant of the Roman Catholic Church. Supposedly a man who is to see to the needs of Jesus' followers on earth, the Pardoner is a crook that takes advantage of the very people he has been called to watch over.
After revealing himself to be a very wicked man, the Pardoner instructs the company with an allegory about vice leading three young men to their deaths.
There is irony in that the Pardoner (who is a terribly sinful man) is telling an allegory that is supposed to offer advice on the value of avoiding immoral conduct—in this case (specifically), avarice (greed).
In "The Pardoner's Tale," the story is about three men who go searching (literally) for Death (which is personified in the story) because "he" took their friend—who drank himself to death. On another level, however, the Pardoner's allegory is the tale about every human being that chooses to live in such a way that he or she eventually dies because of his/her actions. It is supposed to be a tale of morality, but (ironically) the Pardoner is far from a moral man.
In the Pardoner's story, he tells of several young men guilty of riotous and sinful living:
In Flanders some time back there was a troop
Of youths who were a folly-loving group,
What with their parties, gambling, brothels, bars,
Where with their harps and lutes and their guitars
They'd dance and play at dice both day and night.
Among other lecherous behaviors, they drink in excess. One morning, three of them are at the bar before 9:00 a.m. (661) Soon they hear a bell ringing. (This was the custom, to ring a bell as a casket passed by.) One of the three asks a young boy to find out who has died. The boy already knows and says it was an old drinking buddy of theirs. "A stealthy thief that's known as Death" has robbed their friend of his life (675). The youngster explains that Death has been busily doing the same in the face of the recent plague. The boy warns them that Death is a frightening adversary, one to be avoided. The tavern keeper agrees with the boy's report. He believes that Death is living in a town a mile away, and he also offers a warning.
The young men are already drunk and rise up (foolishly) to avenge the death of their friend. They make a promise:
Together then they made their pledge, the three,
To live and die each of them for the others
As if they'd been born naturally as brothers. (702-704)
So joined by their vow, they leave the tavern and search for Death. They promise that when they find Death, he will die! About a half a mile away they meet an old man who they insult terribly, asking him why being so old he is not yet dead. He responds that he has asked Death repeatedly to take him, but still he lives. Excited, the men demand to know where Death is, saying that the old man must be his compatriot and a spy for Death. The old man tries to warn them about pursuing Death, but they will not listen. So he tells them to climb to the top of the hill, and there they will find what they are searching for.
The three depart and at the top of the hill, they find a cache of gold—almost eight bushels of florins (coins). Immediately they forget about searching for Death. The oldest of them announces that if they try to move the gold during the daylight, someone will accuse them of stealing. He suggests that one of them go to town to get bread and wine while the other two stay behind and guard the treasure. They draw straws and the youngest loses.
After the third man has gone, the two that remain swear fealty to one another and agree to kill the third when he returns so they only have to split the money two ways. Meanwhile, the youngest has decided to poison the others with tainted wine so he doesn't need to share the treasure. Upon the youngest man's return, the other two stab him to death and then sit down to drink the wine. Poisoned, they both die.
Ironically, the men go looking for Death, and in their greed they all meet "him."
We see dramatic irony in that all the men are planning on killing each other to get a greater portion of the gold. Though the characters in the story have no clue, the reader can surmise what is going to take place.
We also find dramatic irony in the Pardoner's closing to his tale. He preaches against the sin of "avarice" (greed). However, he is greedy. In reading The Prologue to The Canterbury Tales, we learn that he is selling stolen pardons to the poor. He also sells fake relics: a piece of pillowcase, for example, he claims is a piece of the Virgin Mary's veil; he also asserts to have a scrap from the sail of the ship Jesus sailed on when He walked on water. The Pardoner sells pigs' bones as holy relics. Through all of his deceit he makes more in one day than the Parson (a truly holy man) makes in a month or two.
The Pardoner ends his tale—
Now, good men, God forgive you your trespass
And guard you from the sin of avarice. (904-905)
Ironically, the Pardoner has preached about the fate of the young men that were killed by their greed, and warns his listeners to avoid the same sin. We already know that the Pardoner is as greedy as any of the men in his story. With further irony, as he ends his tale, he tries to get his fellow travelers on the pilgrimage to buy some of this stolen and/or fake goods as well!
The reader can see the dramatic irony not only in his tale, but also in the Pardoner's behavior and warning to his companions.