The primordial spirits, who existed with Ilúvatar, and with Him created the world through the Music of the Ainur. After the creation of Arda, many of the Ainur descended into it to guide and order its growth; of these there were fifteen more powerful than the rest. Fourteen of these great Ainur became the Valar, or Powers of Arda. The fifteenth, Melkor, turned aside from that path and became the first Dark Lord. The many lesser Ainur that accompanied the Valar into Arda are known as Maiar.
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 (the greatest of the Ainur) and the Maiar (lesser Ainur who served them). 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úvatar.
Nature of the Ainur
The Ainur are angelic beings, nonetheless they do possess gender. Even those who later descended to Arda and took on common male and female forms to appear to the Elves in, nonetheless have an inherent male or female gender even when formless. This is because their gender is based on their "temperament", which is independent of any physical form they may assume.
The Line of Melian
Among the many Ainur that entered the World long ago, there was one of the order of the Maiar named Melian. Alone of all the Ainur, she wedded one of the Children of Ilúvatar, King Elu Thingol of Doriath. From her, a strain of the Ainur entered the bloodlines of the Elves and Men, passed down through generation after generation, and was still present at the time of the War of the Ring. Elrond was Melian's descendant, and Aragorn, too, was her descendant, though through many more generations than Elros.
Supposedly it is derived from the Valarin word for Ainur which was Ayanûz.