5 powerful, immortal beings (the Istari) were sent down to Earth in the form of men by a the angelic Valar.
Their mission was to aid men and elves in all their affairs, pushing them to be positive forces.
They 5 wizards were:
Saruman the White 'man of skill'
Gandalf the Grey 'elf of the staff'
Radagast the Brown 'tender of beasts'
Alatar the Blue
Pallando the Blue
The most powerful and head of the wizards was Saruman the White, but due to his desire for more power and his obsession with all the rings of power, he initiated an ill-fated plan to acquire the ring. First he teamed up with the dark lord Sauron, attempting to lull the dark one into a false sense of security. But that plan backfired and Sauron using the palantír of Orthanc (the round dark bowling ball thingy) seduced Saruman's mind to his bidding and thus he truly became allied with the dark one.
Due to Saruman's fall to evil and due to Gandalf the Grey’s own fall against the Balrog in the Fellowship of the Ring, the powers that be resurrected and re-fashioned Gandalf as the new White the replacement to Saruman’s position as head of the White Council.
Radagast the Brown (seen in in The Hobbit) played a big part in aiding Saruman's stand against the dark forces before he turned to the dark side. And in not knowing about Saruman's switch, Radagast was used to lure and capture Gandalf the Grey during his quest of power. Additionally, but also completely by accident, Radagast sent Gwaihir the Eagle to Orthanc, to inform Saruman of the movement of Sauron’s forces, in seeing the Eagle, Gandalf imprisoned at the top of the tower used Gwaihir to escape without Saruman’s knowledge.
The Blue wizards were sent to the distant east of middle earth so they don't factor in, a lucky escape they had or perhaps they too were fighting their own wars...Spin-Off!