Here are two of Chaucer's stories told by the pilgrims in The Canterbury Tales—each teaches a life lesson: the purpose of the allegory.
An allegory is a tale that speaks on two levels. It tells the obvious story; then there is the "subliminal message" or "theme" the author tries to impart—if we look beneath the surface of the original story.
Aesop's Fables were allegorical. In "The Tortoise and the Hare," the turtle (tortoise) takes his time ("slow and steady wins the race") while the hare (rabbit) flies by, racing to the finish line. Confident that the turtle can never catch up, the rabbit naps. He wakes to find the turtle has won. On the surface, the story is simply about a hare and a tortoise. For me, the allegorical message is "don't underestimate your opponent."
In Chaucer's tales, the meanings are rather straightforward.
Remember that Chaucer has a character from the Canterbury pilgrimage tell a tale that is connected to them in some way. Chaucer is highlights an valuable concept—or foolishness—based on each storyteller's characteristics.
In "The Wife of Bath's Tale," the Wife has been married five times—she likes marriage and is looking for husband number six.
She defends at length the moral righteousness of people who marry often...
The Wife is not a gorgeous young woman. She has a "gap-toothed" smile, is deaf, and is not small—she has an "ample hip." She knows she might not appeal to some because of her appearance, and so her tale tells how looks can be misleading.
The Wife describes an Arthurian Knight who rapes a girl. Guinevere says he must answer this within a year to save his life: "What is it that every woman wants?" So he travels trying to find the answer. On the last day an old crone promises to tell him in exchange for a wish. He agrees: the answer is...
Her way in all things with men.
Or...her own way. But the old hag's wish is to marry the knight. He cannot break his word, but dreads it. They marry and he delays going to bed. Then the hag turns into a beautiful woman: she can be beautiful by day and unfaithful at night or vice versa. (There are two versions to this part of the tale.) Wisely, the man chooses to let her decide and he gets beauty and virtue. This proves the Wife's idea that you can't judge a book by its cover.
The Pardoner works for the Church: he cheats the people by selling fake holy relics and the Church by selling stolen pardons (keeping all the money). His story tells of three drunks who hear that Death has taken a friend. So they go looking for—Death, rudely demanding his location from an old man (who may be Death himself):
To find this Death, turn up that crooked way...
On the hilltop they find gold! Forget Death! One goes to get food and wine; the others plan how to move the gold. Two agree to kill the third and split the gold. The third poisons the wine so he gets the gold. He returns; he is stabbed. The other two drink the poisoned wine and die. They "found" Death. The Pardoner's moral:
...greed is the root of all evil...
Ironically, he is greedy.
Each tale has a message; each reflects an aspect of the character that tells it. The Wife is a good woman sharing wisdom. The Pardoner is a cheat who misses the point of his story.
Their similarities: both are pilgrims; both share tales with lessons. Their differences: one is a good person; the other is dishonest. The Wife tells a lesson she can relate to; the Pardoner cannot relate. She is honest; he is a hypocrite.