Since Tolkien wasn’t really trying to write a story, but rather give England what he saw as a lost history, I’d like to offer up how Gandalf’s wisdom is demonstrative of magic as seen by the ancient view of magic. Tolkien had great difficulty defining magic when asked to define the boundaries of Faerie, but based on his writings about Gandalf and what he was able to say about Magic, (plus his insistence on using the Old English Spelling of the word) it is easy to see his concept of Magic more closely matched those of the Ancient World where Magic was the "Great Work" or the work of the "Wise."
In ancient days when people really believed in magic and magical beings such as witches and wizards, there weren’t really “great powers” and spells like we see in so many fantasies and fictions today. In fact, the word magic stems from a title that used to be used for people that practiced Zoroastrianism and could read the stars for signs. The three wise men that brought gifts at Jesus’ birth are also referred to as the three Magi.
Magic came from knowledge of the world. Early wizards, druids, shaman, witches, priests, etc. often knew some chemistry or mechanics (this was the showy part of being a temple priest—mixing the right chemicals and using the right mechanics to make the people think they'd seen signs of the power of the Gods) and had some skills we wouldn’t consider magic at all today. Even Gandalf’s “spells” that he casts and items like his fireworks are related to this aspect of ancient magic.
Magical peoples were usually the religious leaders and were seen as leaders in that sense. Some of them were seen as able to talk to, or raise the dead, some were seen as prescient, and others were healers—it depends on the culture you look at.
By the Middle Ages, magic was seen as having two distinct forms, although there was more of a focus on evil and sorcery (the daemonic form of magic) within the church, belief in natural magic by the people as a way to find healing and protection also remained. Casting coins into wishing wells, Patron Saints and many of our "superstitions" are hold overs from this time. The magic that remained acceptable to all but the most staunch Christians remained rooted in use of natural elements (In northern Europe, particularly in relation to water - wishing wells and healing powers). Additionally, many Christians of the common classes still practiced some “magical rituals” and the Church even placed its holidays near pagan holidays and rolled pagan practices into Church practices (to some extent) in order to help in converting the general populace.
Tolkien’s wizards are in keeping with early Medieval and ancient tradition. They can read signs in nature—see and understand things that others can’t, make predictions, wield magical objects (staffs, rings, and Palantír), once in a while make something appear to have happened that is miraculous to everyone else (spells), and lead and “talk to nature”—communicate with moths and eagles and in Saruman’s case the corvids of Middle Earth.
Ancient wizards were guides mostly and seen as the highly educated. Gandalf clearly fills that role, and does so with superb skill. He takes hints and clues, a suspicion grows and he heads to the library to confirm it. He is able to read signs of things to come, knows the right words to say (not just when it comes to spells but to ease fear and encourage, knows when not to say something. He is seen as a wise man and followed as one.
If you read Arthurian legend from before the twentieth century, you will generally find Merlin to be no greater in his capabilities. They wield the magic of earth, but not necessarily for the purposes of entertainment or convenience the way the wizards and witches in say, Harry Potter, Disney’s Sword in the Stone and other more modern works depict.
Likewise, Saruman is able to use his closeness to nature to affect the weather, but as he forgets his bond with nature, nature actually turns on him. Treebeard is that much more incensed by Saruman’s destruction because he is a wizard and should know better how to treat the nature around him.
Radagast is the most perfect of Istari in regard to demonstrating closeness to and power in channeling nature for his benefit (though he is less perfect in demonstrating leadership over mankind and academic types of wisdom—leading to his failure).
The “spell” Gandalf uses to break the bridge and prevent the Balrog from annihilating the entire fellowship by the way, is one of his least wizardlike moments in the series, when magic is looked at in this way (although I’d have to agree with previous posters it shows him to be pretty powerful with twentieth century thoughts on magic too). The ancients would have seen that moment as his requesting aid from the gods. The bridge-breaking would have been the doing of a god, not the doing of a wizard. Of course, since it is, in fact, fiction, Gandalf does have a few powers an ancient shaman wouldn’t have had as listed by others here.