He was created with them, as he is a maiar, a lesser angel created to help Eru Iluvatar create the world. He and four other maiar were sent down as mortal beings called the Istari, they have many powers but not as much as a regular maiar. When Gandalf the Grey died, his immortal essence was sent back, possibly even by Iluvatar himself, as Gandalf the White. As Gandalf the White, he now had even more of his original maiar powers available to him.
Chat with our AI personalities
He really doesn't use any powers on the trolls. He does throw his voice. He used it to create an argument among them, that distracted them so that they didn't notice the rising sun.
Frodo knows Gandalf because Gandalf was like Bilbo (Frodo's grand-uncle) guardian on Bilbo's adventures. Now, Frodo knows Gandalf through Bilbo.
Gandalf was known by different names to different peoples: Gandalf to Northern men, Mithrandir to the elves and Dunedain (as in Gondor), and Tharkun to the Dwarves. Olorin was his true name as a Maia.
The hobbits of the Shire might describe describe Gandalf as wise, powerful, and fun-filled.(Gandalf is over 3000 years old!)
Gandalf believes in Bilbo, and he says in the book that he wouldn't of brought-en him if he wasn't in good use.