According to Tom Shippey’s work on Tolkien, the name Gandalf came from a Norse mythic poem. The poem is just a list of dwarves. One of the dwarves is named “Gandalf,” which translates to “Wand Elf.” Tolkien looked at the list of names and thought, what the hell is a “Wand Elf” doing with a bunch of dwarves? Boom. There’s the story of The Hobbit in a nutshell. The plot answers that question. Well the wand-elf must be a wizard, of course! And he has joined the dwarves to aid them in some kind of quest. Duh!