Why is it necessary for gandalf to leave
Gandalf leaves the company of the dwarves and Bilbo during chapter seven, just as they are about to enter Mirkwood. Gandalf gives them the excuse that he has pressing business to attend. Later, Tolkien reveals that Gandalf actually left to attend a meeting of the White Council, a meeting between Saruman, Glorfindel, Radagast, and Cirdan to discuss the Necromancer in Dol Guldur. Suspicions run high that the necromancer might actually be the resurgence of Sauron, the deceiver.
Gandalf's leaving the company of dwarves and Bilbo has a significant effect on the story line, forcing Bilbo to prove himself as a professional burglar, against the spiders in Mirkwood and then later to free the dwarves from the Elven king.
check Approved by eNotes Editorial