That is a good question, because we don't truly know who or better yet, what, Gandalf really was.  We do know many things about him however, and the purpose of this page's existence is dedicated solely to the explanation what we know about Gandalf, and his importance to Middle-earth.

To better understand Gandalf, you need to have an understanding of the hierarchy of character's of Tolkien's mythology.  Tolkien did not like allegory, but it is sometimes necessary for clear explanations, so I will use it as lightly as possible here.  In no way shape or form should any of this be confused with any contemporary gods or religous beliefs that people have today.  This is a mythology created by one man, and it shares some similarities with various religions, dead and alive, that have been known to mankind since such things were first created . . .

In the beginning, there was the One, Ilúvatar, or Eru.  Eru was the supreme being, like a god, he was the creator of the universe, and he was there before creation.  To assist him in this creation, he made the Ainur, who were the "offspring of his thought".  Each of the Ainur comprehended one part of Eru's mind, so individually they were not as great as he was, but together they could create great things.  How this was accomplished was by singing.  Eru had his Ainur, join together, and sing everything into exsistance.

Gandalf was one of five wizards that were also know as Istari.  The eldest and the head of the order was Saruman, who's other names include Curunír (Sindarin for "The One of Cunning Devices"), Curumo (Quenyan form of Curunír) and Sharkey (Orkish sharkû, meaning "old man").  The other three members of the Istari were Radagast, Allatar and Pallando.

The Istari ranks were represented by colors.  As head of the order and the most knowledgeable, Saruman was White.  Gandalf, who was second, was Grey, Radagast was Brown and Alatar and Pallando were Blue.  What exactly the color designations mean, we do not know.

To be continued . . . as I have the time, and as I organize my thoughts!