In the very beginning there was Eru, the One, who dwelt in the Void, and whose name in Elvish was Ilúvatar . As is told in the Ainulindalë, thoughts came forth from Ilúvatar to which He gave eternal life through the power of the Flame Imperishable. Ilúvatar named these creations Ainur , the holy ones. They were the first race and they inhabited the Timeless Halls that Illúvatar had fashioned for them.
The Ainur were great spirits and each was given a mighty voice so that he could sing before Ilúvatar for His pleasure. When He had heard each sing, Ilúvatar called them to Him and proposed that they should sing in concert. This was what the tales call the Music of the Ainur, in which great themes were made as individual spirits sought supremacy or harmony according to their nature. Some proved greater than others; some were powerful in goodness, some in evil; yet in the end, though the battle of sound was terrible, the Music was great and beautiful. From this harmony and strife Ilúvatar created a Vision that was a globed light in the Void. With a word and the Flame Imperishable He then made Eä, the World that is; Elves and Men later named it Arda, the Earth. The Music became the Doom of Arda and the fate of every race was bound to it, save that of the late-coming race of Men, whose end nobody but Ilúvatar knew.
So it was after Arda was made, some of the Ainur went down into this newly created World, where they were known as the Powers of Arda. Later they were thought by Men to be gods. Those who were good among them were guided by their own ends. Whereas in the Timeless Halls they had been beings of pure spirit, within Arda they were limited in power by choosing to inhabit the bounds of Time and the small space of the World. Further, within Arda they took on separate shapes, each according to his nature and the elements he loved, and, though not bound to a visible form, they most often wore these shapes as garments, and in later Ages they were known to Elves and Men in these forms.
In the Valaquenta a part of the long history of the Ainur who inhabited Arda and shaped the World is written. It tells how the kingdoms of Almaren, Utumno and Angband were built in Middle Earth; and how the kingdom of Valinor was made in the Undying Lands of Aman. It speaks also of how the Ainur brought forth Light and the Count of Time, and how there were terrible wars among them that shook Arda; and it gives the names and forms of many of the mightiest of the race.
In Arda the Elves divided this race into the Valar and the Maiar. Those of the Ainur counted among the Valar are:
Varda, Lady of the Stars
Nienna, the Weeper
Yavanna, Giver of Fruits
Vána, the Ever-young
Vairë, the Weaver
Estë, the Gentle, healer of hurts and of weariness
Nessa, the Dancer
Many of the Ainur were counted among the Maiar, but only a few are named in the histories that have come down to Men: Eönwë, Herald of Manwë, Ilmarë, Maid of Varda; Ossë, of the Waves; Uinen, of the Calm Seas; Melian, Queen of the Sindar; Arien, the Sun; Tilion, the Moon; Sauron, the Sorcerer; Gothmog, Lord of the Balrogs; and Olórin (Gandalf), Radagast and Curunír (Saruman) - the Wizards. In the histories of Middle Earth there also appear others who may have been Maiar: T huringwethil, the Vampire; Ungoliant, the Spider; Draugluin, the Werewolf; Goldberry, the River-daugther; and Iarwain Ben-adar (Tom Bombadil).
Origins of the Ainur
The Ainur were the first, and mightiest, beings created by Ilúvatar in the depths of time before the beginning of the World. The Ainur were the 'offspring of Ilúvatar's thought', and each was given understanding only of that part of the mind of Ilúvatar from which he or she came. The exception to this was Melkor, the greatest of the Ainur, who had a part of the gifts of all the others.
The Ainur were 'kindled with the Flame Imperishable', which can be taken to mean that they were granted free will by their creator. Ilúvatar instructed them in the arts of music, until he brought them together to make the Music of the Ainur; the great song that created the Vision of Ilúvatar and ultimately the real World.
The Ainur and the World
Through the Music of the Ainur, Ilúvatar created a Vision of the World; he showed it to the Ainur, and explained much of its nature and destiny to them - so the Ainur have much knowledge of the World, but are not omniscient. Then, Ilúvatar granted the World true being. Melkor and many of the other mighty Ainur desired to descend into it and form it in readiness for the coming of the Children of Ilúvatar (that is, Elves and Men). These became the beings known as the Valar and the Maiar.
Those Ainur who entered the World at its beginning remain bound to it until its end. Though Melkor was eventually thrown into the void by the others, he is prophesied to return before the end. Little is known of the ultimate future of the Ainur, even by themselves, but it is said that, after the great battle at the end of the World, they will make a Second, even greater, Music with the Children of Ilúvator.