Gareth is the youngest son of Lot and Bellicent. His older brothers, Gawain and Modred, have become knights of King Arthur, but he is forced to remain at home with his mother since he is still considered a mere boy. Because of this overprotectiveness, he is unhappy. He realizes that his mother loves him and that he must be obedient to her wishes, but he is frustrated because a life of chivalry is what he really aspires to.
Finally Gareth speaks to his mother about his desire and, despite her fears, is able to coax her into giving him permission to go to Camelot. She makes only one demand: he must go to Arthur's court in disguise and work for a year as a common kitchen-knave before revealing his identity. She hopes that this demeaning condition will make Gareth reconsider. He remains determined, however, so Bellicent keeps her word and lets him go.
Gareth disguises himself and, accompanied by two servants, sets out for the magical and rich city of Camelot. They are frightened and awed by the imposing spectacle of the capitol, especially by its high walls, on which are sculptures of the Lady of the Lake, symbolizing the True Religion, and the Three Queens, representing Faith, Hope, and Charity. These signify to the whole world the principles by which Arthur guides his kingdom. Gareth and his servants enter the city and are greeted by Merlin. After a short conversation, he directs them to the palace.
In the great hall Gareth observes the fairness with which Arthur delivers judgments and satisfies the petitions of suppliants. When his turn comes, Gareth asks for and is granted a position as a menial in the palace kitchen. He promises that in a year he will identify himself and fight faithfully for the king.
As time passes, Gareth continues to work in the kitchen. He is popular among the other servants, but is often bullied by his supervisor, Sir Kay. Eventually Gareth learns that Bellicent has relented in her demand and has released him from his one-year vow.
Still hiding his true identity, Gareth begs of the king the right to go on the next quest that a knight is required to perform. Despite protests from Kay, Arthur grants this request and permits the boy to keep his identity secret for the time being.
That same day, a beautiful and high-born maiden named Lynette appears at the court. She relates a sad story about how her sister Lyonors and the rest of her family are kept prisoners in Castle Perilous by four fierce knights. She has come to Camelot to gain the assistance of the greatest knight, Sir Lancelot, in freeing them. The king agrees to help, but assigns the task to Gareth. Lynette is indignant, for she thinks that Gareth is a lowly kitchen-knave and that this is Arthur's way of insulting her. Nevertheless, Arthur provides Gareth with horse and armor and sends him on the quest.
During the journey to Castle Perilous, Lynette is sullen and unfriendly to Gareth. She frequently berates him for his low birth and lack of ability and makes him ride several paces behind her. Despite Lynette's demeaning behavior, Gareth remains humble and patient.
While passing through a forest, Gareth rescues a local baron who had been captured by some ruffians, but Lynette declines to credit him for this conquest and attributes his victory to luck. The baron entertains them at his castle. At dinner, Lynette refuses to sit at the same table with Gareth. Afterward, they continue their journey.
Eventually the pair arrive at Castle Perilous. One after the other, in hard fights, Gareth vanquishes the first three knights. Very slowly a change begins to come over Lynette's feelings. Initially she begins to only respect his skill and prowess as a warrior, but soon she comes to realize that he is actually of noble birth and, moreover, a chivalrous and honorable knight. She apologizes to him for her previous crude behavior.
Lynette and Gareth are now joined by Lancelot, whom Arthur had sent to protect and assist them. Lancelot's shield is covered when he first approaches, and they do not recognize him. He and Gareth fight and, of course, the youth is defeated. Gareth is mortified and Lynette reproaches him for losing, but Lancelot graciously convinces them that there is no shame in defeat. He offers to fight the fourth knight, since this is what Arthur sent him for, but Gareth refuses. Instead, Lancelot advises Gareth as much as possible in the art of personal combat. Gareth engages the last and fiercest of the knights in a bitter fight and is triumphant. Castle Perilous and the Lady Lyonors are liberated and a merry celebration follows. Later on Gareth and Lynette are wed.
Although one may read it as a purely romantic adventure tale, this idyll (like several of the others) may also be taken to be a profound allegory. The serpentine river surrounding Castle Perilous can be interpreted as the stream of time. Its three long loops represent the three stages of life — youth, middle age, and old age — and the three knights at the crossings are the personifications of the temptations typical of these ages, all of which Gareth must overcome in his effort to be a true knight, one worthy of Lynette. The last knight represents Death. The allegorical principle here is that Death, which seems the most formidable of all opponents, is easily defeated, and its defeat yields a new and innocent life.