My Dear Frodo, you asked me once if I had told you everything there was to know about my adventures. While I can honestly say I have told you the truth, I may not have told you all of it…
Long before Bilbo's involvement, the Dwarf Thrór becomes King of the Lonely Mountain and brings an era of prosperity to his kin until the arrival of Smaug the Dragon. Smaug destroys the nearby town of Dale before driving the Dwarves out of the mountain and taking their hoard of gold. Thrór's grandson Thorin sees King Thranduil and his Wood-elves on a nearby hillside and is dismayed when they take their leave rather than aid his people, resulting in Thorin's everlasting hatred of Elves.
In the Shire, young Bilbo is tricked by the wizard Gandalf the Grey into hosting a party for Thorin and his company of Dwarves: Balin, Dwalin, Fíli, Kíli, Dori, Nori, Ori, Óin, Glóin, Bifur, Bofur and Bombur. Gandalf's aim is to recruit Bilbo as the Dwarves' "burglar" to aid them in their quest to the Lonely Mountain. Bilbo is, at first, unwilling to accept but has a change of heart and joins the company on their journey to the Lonely Mountain. Traveling onward, the company gets captured by Trolls. Bilbo stalls them from eating the company until dawn, when Gandalf exposes the Trolls to sunlight, turning them to stone. They search the Trolls' cave and find treasure and Elven blades. Thorin and Gandalf each take an Elf-made blade—Orcrist and Glamdring, respectively—with the latter finding an Elven shortsword, which he gives to Bilbo.