*The novel and the movie The Hobbit are different.
Gandalf’s search on Thrain II
Gandalf has been actively collecting information and intel of the darkness dwelling on Middle-Earth. The elves called Gandalf Mithrandir, the Grey pilgrim while the humans would call him Gandalf or Incanus while the dwarves called him Tharkun.
Gandalf has been residing in Eriador where he has befriended the hobbits at the Shire as Gandalf helped them restore the damage of the Long Winter.
Gandalf also became aware of the dwarves of Durin’s Folks at the Blue Mountains that were at exile because of Smaug’s seizure of Erebor.
After Thrain II went missing, Gandalf started to search for him at Khazad-dum first and then he secretly reached Dol Guldur. Gandalf found Thrain II encaged at Dol Guldur.
Gandalf’s confirmation of Sauron’s return at Dol Guldur
Thrain II would tell Gandalf that his ring of power was ripped off by the Necromancer that was assumed a Nazgul by the White Council residing in Dol Guldur. Thrain II handed over the secret map to the back door of Erebor and the secret key to the secret back door as well to Gandalf.
Gandalf also discovered that the Necromancer of Dol Guldur was no Nazgul but it was Sauron himself that has kidnapped and tortured Thrain II to retrieve the rings of power.
Gandalf barely managed to escape Dol Guldur while Thrain II eventually died as he was already worn out. Sauron already successfully recovered all the rings of power except for the four rings of the dwarves that were swallowed or taken by the dragons in the Grey Mountains. Gandalf alerts the White Council of return of Sauron.
The White Council, Gandalf’s urge to attack Dol Guldur vs. Saruman’s Objection
After Sauron’s return was confirmed, the White Council once again assembled at Rivendell and Gandalf demanded an immediate attack on Dol Guldur and Sauron. Gandalf feared that if Smaug and Sauron allied there would be no forces able to stop them.
However, Saruman went against Gandalf as Saruman claimed that Sauron wouldn’t be able to take action without the One Ring that already went missing. Saruman and Gandalf were both aggressively irritated by each other. While the final decision of the White Council was to hold off the attack on Dol Guldur.
Saruman’s search at the Gladden Fields
Gandalf was suspicious of Saruman’s strong objection against the attack on Dol Guldur while Saruman did have his own intentions with Sauron. Saruman secretly planned to possess the One Ring to control Sauron as Saruman’s core belief was evil must be controlled by a greater power.
Saruman objected to the attack on Dol Guldur because Saruman thought that Sauron would give clues on the location of the One Ring. Nevertheless, Saruman would send search parties to the Gladden Fields to search for the One Ring.
The withering of the White Tree of Gondor
The White Tree of Gondor that stood at Minas Tirith eventually withered and was placed the Tombs of Kings while its dead body still stood on Minas Tirith. The White Tree of Gondor would remain dead until the return of king of Gondor Aragorn II.
Marriage of Arathorn II and Gilraen and the birth of Aragorn II
Arathorn II became the Chieftain of the Dunedain and the leader of the northern rnagers that were secretly protecting the north of Eriador from evil. Arahtorn II married another descendant of the Dunedain named Gilraen and after two years from their marriage, Aragorn II the great hero of the Lord of the Rings was born.
Aragorn’s adoption by Elrond
After two years since Aragorn II was born, Arathron II was killed by orcs while he was hunting down a party of orcs with Elladan and Elrohir the twin sons of Elrond.
Gilraen would send Aragorn II to Rivendell (Imladris) to Elrond as a foster child. Elrond would name Aragorn II Estel which means Hope in Quenya to conceal the young heir of Isildur and Anarion, the chieftain of the Dunedain.
Start of ‘The Hobbit’ – Gandalf and Thorin Oakensheield’s meeting
Throrin Oakenshield became the king of the Durin’s Folk dwarves in exile at the Blue Mountains. Gandalf was greatly concerned about the possibility of the alliance of Smaug and Sauron while Thorin Oakenshield was sick of residing in the Blue Mountains where the resources for the dwarves were scarce.
Gandalf visited Thorin Oakenshield as he held the map to the secret backdoor of Erebor and the key to it as Thrain II handed them over to Gandalf at Dol Guldur. Gandalf handed over the last heirlooms of Thrain II to Thorin Oakenshield and proposed a plan to take over Erebor to Thorin.
Thorin Oakenshield who was desperate to recapture Erebor and defeat Smaug agreed to Gandalf that marked the start of the stories of The Hobbit.
The Hobbit – Bilbo Baggins
The hobbits of Shire were usually very shy and humble while they didn’t want to wander off a lot. Bilbo Baggins was a hobbit that had an unusual amount of interest in the stories and histories of Middle Earth and longed for adventure.
Gandalf would often visit the Shire telling stories of Middle Earth while he noticed Bilbo Baggins was specifically courageous and desperate for an adventure.
Gandalf knew that to deal with the powerful dragon Smaug, he needed someone or something that dragons would be unfamiliar with as Smaug could smell a dwarf from a distance. Gandalf believed Bilbo Baggins would be the best option for his and Thorin Oakenshield’s Quest for Erebor.
Thorin and Company
Gandalf would inform Thorin Oakenshield to assemble a small company for their quest for Erebor. Gandalf then visited Bilbo Baggins where Bilbo invited Gandalf for tea. Gandalf sent a message to Thorin Oakenshield of Bilbo Baggin’s house.
The thirteen dwarves and Gandalf would then take place at Bilbo Baggin’s house where they would sing songs of how much they missed Erebor.
Gandalf and the dwarf got into an argument about hiring Bilbo Baggins as a thief for the quest for Erebor while Bilbo Baggins also initially refused to join Thorin and Company.
However, Bilbo Baggins who was longing for adventure eventually joined Thorin and Company to recover the Arkenstone from Smaug and takeover Erebor.
The dwarves Dori, Nori and Ori from the House of Durin, Bifur, Bofur and Bombur from descendants of Khazad-dum, Oin, Gloin and Groin the cousins of Balin and Dwalin, Balin and Dwalin who were descendants of Nain II and Thorin Oakenshield the king of Durin’s Folks formed the Thorin and Company and headed to the Lonely Mountains, Erebor.