In a 1933 letter, C.S. Lewis (author of the beloved Narnia books) comments on having just finished reading Tolkien's manuscript of The Hobbit: "Whether it is really good (I think it is until the end) is of course another question: still more, whether it will succeed with modern children" (source: They Stand Together: The Letters of C.S. Lewis to Arthur Greeves, 1914-1963, pg. 449). Obviously, history has shown that The Hobbit has indeed succeeded with modern children. What's interesting about this quote, though, is that Lewis thought The Hobbit was really good until the end. Now, of course Tolkien continued to revise the manuscript between 1933 and 1937 (and even after the first edition came out), but the question of what Tolkien is up to at the end of the book is still open.
The last couple of chapters of The Hobbit, with the sudden outbreak of the Battle of Five Armies, seems surprising in a novel that's otherwise pretty focused on the quest of a bunch of dwarves (and Bilbo) for honking amounts of gold. This sudden opening out of the book to deal with the doings of men, Wood-elves, dwarves, goblins, Wargs, Eagles, and wizards sets the stage for The Lord of the Rings cycle that's going to be published twenty years later, so obviously Tolkien had a lot left to say about Middle-earth (his imagined land). Still, there's something a little out of balance about suddenly seeing so many big world events spiraling around little Bilbo Baggins.
But this is part of the point of The Hobbit: even though its main character is, in the words of wizard Gandalf, "only quite a little fellow in a wide world" (19.36), he still has a hand "in bringing [prophecies] about" (19.36). The Hobbit is like an exercise in the Butterfly Effect, where one small event causes the entire world to change. Just think: if Bilbo had not found the Arkenstone of Thrain before Thorin did, he wouldn't have been able to help Bard and the Elvenking gain some power over Thorin. And perhaps the single most important event of the entire Lord of the Rings series happens in passing, when Bilbo puts his hand out in the dark of the Misty Mountains and finds a small golden ring that happens to make him invisible (5.2). So Bilbo's story is part of a much larger series of tales, and his narrative needs a beginning, middle, and end even if the rest of Tolkien's imagined world is going to continue on without him.
To that end, The Hobbit has an absolutely beautiful structure, in which the first chapter promises us:
This is the story of how a Baggins had an adventure, and found himself doing and saying things altogether unexpected. He may have lost the neighbors' respect, but he gained – well, you'll see whether he gained anything in the end. (1.3)
And indeed, by the last chapter, we do see that Bilbo has lost the respect of the people of Hobbiton. They think he's a bit crazy, and no one believes his nutso stories of elves and dragons. All the same, we have also learned all that he has gained: "for ever after he remained an elf-friend, and had the honour of dwarves, wizards, and all such folk as ever passed that way" (19.27). Bilbo has completed his quest with honor and skill, and even if he's no longer quite as boring as the other hobbits would like him to be, he is "quite content" (19.28). The fact that his neighbors don't believe his colorful stories is proof of exactly how safe Bilbo is at the end of The Hobbit: Hobbiton remains untouched by the goings-on far outside its borders (at least, until The Fellowship of the Ring – but we won't give you too many spoilers here).
We all know that the only real ending to a fairy tale is, "they lived happily ever after." And Tolkien, in the best tradition of fairy tales, gives us the pleasure of being reassured: "[Bilbo Baggins] remained very happy to the end of his days, and they were extraordinarily long" (19.29). What's more, the area around the Lonely Mountain has been reborn, "and much wealth went up and down the Roaring River; and there was friendship in those parts between elves and dwarves and men" (19.32). Both the world and Bilbo Baggins find themselves in a better place at the end of the novel than they were in the beginning – the sure sign of a successful quest and a happy ending.