It's probably not a big leap to consider the whole concept of the quest in fantasy literature as a metaphor. The question is, what is it a metaphor for?
The hero's quest as a story is something that has existed in literature for literally thousands of years. You see it frequently in Greek mythology with the stories of Theseus or Perseus. The hero has to go on a journey against great odds to either find a treasure or defeat a creature or some other powerful foe. During the quest the hero will be tested on many occasions, and by the time the hero reaches the goal of his quest, he has grown to a point where he is “ready” to face it. When the hero accomplishes the object of his quest, he returns from whence he came a different person, risen in status as well as wisdom. (Please note: I'm using the masculine gender as a shortcut, not as an assumption that women can't go on quests. I personally think it's neat when women go on quests.)
We all know the general structure, something Joseph Campbell outlined very neatly in his writings about heroes. The question though is thus, what is the deeper significance of the quest? Why do we as human beings find the quest story so compelling, and what does that say about us?
The quest as a structure is a metaphor itself for the life struggle. It is a metaphor for the journey through life and the development we must all go through in order to function as a fully developed adult. It is, if you will, a spiritual journey, a path of growth from someone young and brash (and often impetuous and stupid) to an older person imbued with wisdom as a result of the quest. The journey then becomes the teacher, the guru, and the obstacles that a hero must face are the mental obstacles within us that keep us from achieving wisdom.
Let's take a couple of popular examples. We'll start with Katniss Everdeen's story in The Hunger Games. Here we have the quintessential proto-hero; she's daring, independent, skilled, reliable, and charismatic. She begins her her's journey with a stunning act of selflessness, taking the place of her younger sister in the “Hunger Games”, a yearly battle to the death of twenty-four young people, two from each district in the dystopic remains of the United States, broadcasted to everyone. Katniss has almost certainly given herself a death sentence, for only one person from the games will emerge alive. Yet as this brave young lady goes on her journey, which begins as she is shipped out of her impoverished home district and brought to the wealthy Capitol Region where she learns about how the larger country which she lives in works, changing from a provincial attitude from one of greater understanding. During the games themselves, Katniss becomes acutely aware through her own actions and how they are viewed by the outer world. She gains a wisdom not just about combat but about how society sees people like her and where she fits in it.
Let us take a different sort of quest now, a quest not for selfless reasons but to satisfy that deep desire that lives in every person's soul, the desire for treasure. In The Hobbit, Bilbo Baggins is a satisfied little creature, content to live in his hobbit hole and whittle away the time eating cakes and tending his garden. Then appears in the first few pages the wizard Gandalf who invites the diminutive hero to join on a quest with twelve dwarves to seek treasure. This treasure of course isn't just sitting around unguarded; it's the hoard of the great and powerful dragon Smaug who stole it from the dwarves many years before. Bilbo somewhat unwillingly agrees to join the dwarves. He's not particularly interested in the treasure but is moved by Gandalf's and the dwarves entreaties to join as the group burglar. After many adventures in their journey, some proving Bilbo's worth as a companion, the thirteen (Gandalf is on an “errand”) reach the dragon's treasure. Yet even after the treasure is obtained, the danger sadly isn't, for every group of beings who live nearby now want it, which begins, to Bilbo's horror, the war of the Five Armies. At the end of the battle, Bilbo is disgusted by the whole affair and saddened by the deaths of friends. He returns home richer but content that the small pleasures of home, good cooking, his pipe, quiet nights, good friends and neighbors, are that which makes a man truly rich.
Interestingly, when we meet Bilbo again in the beginning of The Fellowship of the Ring, we find that he hasn't changed much in terms of his physical surroundings. Bilbo has grown more cantankerous, clearly through the influence of Gollum's ring, but he hasn't splurged on anything despite his wealth. His home, Bag End, is still the same hole. His friends are the same as they've been. The only real difference is that he's taken in his young cousin Frodo, an act of generosity the former Bilbo may not have been able to do.