The Hobbit is set in the rich fantasy world Tolkien would come to call Middle-Earth. This imagined world has a great deal in common with the real world, especially Tolkien's home country of the United Kingdom. Throughout Bilbo's journey, the reader encounters familiar plants, animals, landforms, smells, foods, and ideas, with some notable differences. For example, while the cardinal directions are the same, east is at the top of the map instead of north. There are also diverse magical beings (dwarves, elves, hobbits, wizards, humans, eagles, goblins) that all have their own languages and civilizations.
Tolkien uses a familiar-but-foreign setting to emphasize the idea that he is a translator who is pulling the story together out of archival documents. The story is outlandish, but Tolkien finds ways to make it understandable to the reader at home. For instance, he describes something called cram as a plain and tough biscuit-like substance the characters bring with them for sustenance on long journeys. This particular food is unique to the fantasy world, and yet he draws on familiar foods and sensations when he describes it so that the reader gets a vivid sense of what it would be like to eat it. Tolkien, a linguist, delights in finding the right words to make his imaginary, "foreign" world feel concrete, alive, and fleshed out to English-speakers who have never been there.
One source of contention about the setting of Tolkien's books is the way it represents race. The magical beings in The Hobbit do not just look different from one another; they also have distinct personality and cultural characteristics that delineate them. For instance, the goblins are unintelligent, violent, and evil, while the elves are highly cerebral artists with complex motives. Many readers have rightly noticed that the goblins conform to anti-Black and antisemitic stereotypes. By contrast, the elves come across as White much of the time, and sometimes Indigenous. Hobbits, meanwhile, are unworldly homebodies who prefer to isolate themselves from the rest of the world. Tolkien seems to imagine them as White "country bumpkins" who obsess about their social status within their small, insignificant neighborhoods. Tolkien thus leans on real-world ideas about race and even class as shortcuts to describe the politics of Middle-Earth.
At the same time, the narrative of The Hobbit is driven in part by the idea that people can defy expectations and challenge social categories. Bilbo is constantly pulled between his hobbit-like desire to be cozy at home and his "Tookish" part, which is always looking for an adventure. People believe that the Tooks must have some fairy blood because they are more worldly than other hobbits, but this ancestry is unconfirmed. Bilbo surprises himself and many others along his journey by displaying bravery and wit that no one thought hobbits could show. He expands the definition of a hobbit. The novel thus breaks the rules of its own world, suggesting that social categories might not be as fixed as they seem.