Poverty/Class
Lagerlöf forefronts the poverty endured by the vagabond—in the very first paragraph, she describes his destitution. She tells her reader that though he sells rat traps to survive, "the business was not especially profitable, so he had to resort to both begging and petty thievery to keep body and soul together. Even so, his clothes were in rags, his cheeks were sunken, and hunger gleamed in his eyes" (66). The tone of the story is not one of judgment; the reportorial manner with which Lagerlöf simply lays out the facts of the vagabond's condition suggests that Lagerlöf recognizes the impossible challenge of surviving poverty while also following the law and abstaining from thievery.
On the other hand, Lagerlöf also portrays the crofter and the Willmanssons, who represent, respectively, two socioeconomic classes that are very distinct from each other and from the vagabond's. The crofter seems to have his needs met, but he still relies on his cow for a living. In other words, he needs the money that the vagabond steals from him. The Willmanssons are the richest people in this story. They live in a large house on a spacious lot, and Mr. Willmansson owns a successful iron mill. Edla, the Ironmaster's daughter, feels a strong desire to provide for the vagabond, despite the initial deceit of him allowing the Ironmaster to think he was a former war buddy. Perhaps Edla feels this obligation because she recognizes that she and her father have so much, while others have so little.
Pessimism
Closely related to the theme of poverty is that of pessimism. Lagerlöf interweaves these themes, demonstrating how a life in poverty can lead to desperation and disillusionment. This is why the central metaphor of the story, the vagabond's theory that all good things in the world are simply different forms of bait luring people to their respective demises, is so rooted in a pessimistic outlook on the world. This outlook originates in the experience of someone (the vagabond) who rarely has enough resources to feed and clothe himself. The vagabond is actually quite happy when he comes up with the rat trap metaphor for the world because, Lagerlöf writes, "the world had, of course, never been very kind to him, so it gave him unwonted joy to think ill of it in this way" (66).
Furthermore, any act of kindness or generosity surprises the vagabond. Lagerlöf writes that he is usually greeted by "sour faces" when he knocks on a door looking for food or shelter. The kindness of the crofter comes as a surprise, and the incessant kindness of Edla, even after they find out that the vagabond is not who they thought he was, downright shocks him. As he sits down for Christmas dinner, Lagerlöf describes his confusion: "Time after time he looked at the young girl who had interceded for him. Why had she done it? What could the crazy idea be?" (72-73). The man doesn't believe himself worthy of kindness, and so he questions the motives of those who extend kindness to him. The moral of Lagerlöf's tale is that people's actions often reflect the expectations that others hold for them, and for the first half of the the story, the vagabond holds the pessimistic view that strangers simply cannot see his value as a human being.
Hospitality
It is worth noting that the events of the story take place on and around Christmas Day. The biblical story of Christmas involves Mary and Joseph traveling to Bethlehem, where they are told that there are no rooms available at the local inn. The lack of vacancy results in Jesus being born in a manger, in a barn. When Edla appeals to her father to let the vagabond stay, she cites the holiday as her main argument. Lagerlöf writes, "That morning she had felt so happy when she thought how homelike and Christmassy she was going to make things for the poor hungry wretch" (72). And when Edla speaks on behalf of the vagabond, she says to her father, "I don’t think we ought to chase away a human being whom we have asked to come here, and to whom we have promised Christmas cheer" (72).
It is this very hospitality that gives the vagabond the confidence to return the money. In his note, he writes, "The rat trap is a Christmas present from a rat who would have been caught in this world’s rat trap if he had not been raised to captain, because in that way he got power to clear himself" (74). The theme of hospitality exists at the center of the story's moral: that people will often act in accordance with others' expectations of them, and that therefore, people should treat each other well. The vagabond writes that their hospitality gave him "power to clear himself," suggesting that he actually gained agency from their generous hospitality.
Loneliness
The most subtle theme in this otherwise unsubtle, didactic tale is loneliness. In each act of the story, Lagerlöf introduces a new character who is motivated by their loneliness. The first is, of course, the protagonist, the vagabond, about whom Lagerlöf writes, "no one can imagine how sad and monotonous life can appear to such a vagabond, who plods along the road, left to his own meditations" (66). The vagabond's loneliness and sense of alienation and isolation from the human community significantly contribute to his pessimism.
Then there is the widower crofter, who seems almost as happy to invite the vagabond into his home as the vagabond is to be invited. Lagerlöf describes the crofter as "an old man without wife or child, [who] was happy to get someone to talk to in his loneliness" (67). The crofter is radically trusting of his guest, and he goes so far as to show the vagabond exactly where he keeps his money and how much he has. The crofter is so happy to have human contact that he doesn't even think to judge the vagabond.
And finally, there is Edla, who lives in a big, mostly empty house with her widower father. She wants to host the vagabond for Christmas out of the kindness of her heart, but when the Ironmaster threatens to throw the vagabond out, Lagerlöf writes that "[Edla] had felt so happy when she thought how homelike and Christmassy she was going to make things for the poor hungry wretch" (72). The idea of a fuller house gives Edla joy, and it is clear that her motivations are not entirely altruistic. She desires the company. "The Rat Trap" is a story in which lonely people are motivated to be kind in order to feel connected to other human beings.