"The Quest of Erebor" in "Unfinished Tales" elaborates upon the story behind "The Hobbit". It tells of a chance meeting between Gandalf and Thorin Oakenshield, a Dwarf-king in exile, in the inn of the "Prancing Pony" in Bree. Gandalf had for some time foreseen the coming war with Sauron, and knew that the North was especially vulnerable. If Rivendell were to be attacked, the dragon Smaug could cause great devastation. He persuaded Thorin that he could help him regain his lost territory of Erebor from Smaug, and so the quest was born.