There is a disappointing lack of scholarship regarding "Smith of Wootton Major" in the context of Tolkien's philosophy, but perhaps that is for the best; Tolkien himself detested allegory, and much of the fragile wonder and mystery found in this tale could easily be lost in the mechanistic process of hyper-analysis.
Regardless, this short story, despite being so often overlooked in Tolkien's body of work, is masterful, and the ideas he expresses within are integral to his overarching philosophy of narrative. For essential background reading, check out his essay "On Fairy-Stories;" it plainly describes many of the elements incorporated into this fairy-tale, more eloquently and concisely than a short analysis passage ever could.
The primary theme of "Smith of Wootton Major" is the intersection of Imagination and Truth. In the aforementioned essay, Tolkien complains that "fairy-tales" are considered childish fancies and nothing more, toys to be discarded and left behind in the process of maturity. He argues, conversely, precisely the opposite: fairy-stories are by no means childish, and there is a beauty and a danger that lies in the realm of Faërie (a loose term created by Tolkien to describe the otherworldliness that lies in the heart of Secondary Creation - that is, the most purely manifested result of Art). The short story reflects this frustration: when Nokes dismisses fairies as silly children's stories, Alf (who is in fact the Fairy King) grows frustrated, and his sadness at the children's similar perceptions is apparent. The whole town of Wootton Major, in fact, seems to think the imagination is merely a childish device, and they live their mechanistic lives perfunctorily and in a manner they deem suitably mature.
Against this unimaginative backdrop, Alf guides a fairy-star into the cake of a young boy called Smith, who, having ingested the Star (a symbol of the fantastic imagination), develops a newfound sensibility to Beauty. This manifests itself practically in the ability to travel to Faërie, which serves as a fictional metaphor to represent the use of the imagination in life to look beyond the physical to see the flashes of Truth and Beauty in the fringes and patterns of Creation, often glimpsed through fanciful tales and wondrous stories. Understandably, Smith grows different from the rest of the town, and he hides the stories of this perilous beauty because he realizes that the others would only disbelieve and trivialize Faërie.
Far from being escapist in a negative sense, however, Faërie serves to heighten Smith's enjoyment of "the real world" as well. When he is in danger of using Faërie as a replacement of his own world, it is revealed that he must give up this ability and pass it to a child who is to be his successor, paralleling the Master Cook position in the village of Wootton Major. Alf, the apprentice from the beginning of the story, turns out to be the King of Faërie, and his disappointment with Nokes and the rest of the calloused, disbelieving village is obvious in the final pages and the last dramatic scene when he reveals his true identity to the old, fat cook.
Yet this moment of anger is a rare one in Tolkien's portrayal of Faërie, as seen in both "Smith of Wootton Major" and "Leaf by Niggle." More often than not, the emotions expressed by the imaginative toward the nonbelievers are sadness and pity; it is difficult, in context of the transcendentals, to not care for your fellow man, and wrath is often passed up in favor of compassion.
In a sense, the world of Faërie is even more real than this primary, physical world, in that it affords glimpses of a higher reality than this one (in Tolkien's Christian framework, Heaven). Although never explicitly stated, this can be implied from several passages in the story. A notable example is the interaction between Smith and his son; when Smith returns from a great journey, his son remarks, "You look like a giant, Dad," an image which contains echoes of the realm from which he has come. When Smith returns from his final journey to Faërie, his (now more mature) son says this: "... I said that you looked like a giant by your shadow. The shadow was the truth."
There is much more that could be unpacked in an analysis of this story, but impersonal academia strips the beauty from stories and lays it out for scientific examination. For a deeper explanation of the philosophy behind "Smith of Wootton Major," read Tolkien's essay "On Fairy-Stories." In any case, the only way you can truly understand and appreciate this story is to go read it yourself and get lost in the realm of Faërie.