The Maiar (singular: Maia) are beings from J. R. R. Tolkien's fantasy legendarium. They are lesser Ainur who entered Eä in the beginning of time. Tolkien uses the term Valar ('powers') to refer both to all the Ainur who entered Eä, and (more often) specifically to the greatest among them, the fourteen Lords and Queens of the Valar. So the Maiar are at the same time lesser Valar and the helpers of the (greater) Valar. 'Valar' without qualification generally refers to the Ainu who left Eru to dwell in Ea.
According to the Valaquenta in The Silmarillion, each of the Maiar was associated with a particular Vala; for example, Ossë and Uinen, who were spirits of the sea, belonged to Ulmo, while Curumo, who came to be known in Middle-earth as Saruman, belonged to Aulë the Smith. Sauron also belonged to Aulë, before he was corrupted by Melkor.
Being of divine form and possessing great power, the Maiar could wander the world unseen or shape themselves in fashion of Elves and other creatures; when wearing a mortal guise their bodies could be killed, but their spirit would live on.
Melkor (known to the Elves as Morgoth), the evil Vala, corrupted many spirits into his service, both before and after entering Eä. These included Sauron, the main antagonist of The Lord of the Rings, and the Valaraukar, demons of flame and shadow that came to be known as Balrogs.
The uncorrupted Maiar remained in the service of the Valar. Eönwë was the herald of Manwë and led the hosts of the West in the War of Wrath in which Morgoth was finally overthrown and Thangorodrim destroyed.
In about T.A. 1000, the Valar sent Maiar to Middle-earth to help contest the evil of Sauron; they still had great skills of hand and mind but were cloaked in the guise of men, seeming old and weak. Their mission was to guide elves and men by gaining trust and spreading knowledge, not by ruling them with fear and force. They were known as the Istari, or Wizards, and included Gandalf the Grey (Olórin or Mithrandir; later Gandalf the White), Saruman the White (Curumo; later renamed Saruman of the Many Colours), Radagast the Brown (Aiwendil), and two Blue Wizards who do not feature in the main Lord of the Rings series.