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, a brother in spirit to Manwë, who later became The Lord of the Valar and he was given some of the parts from which the others had come, but for all his gifts he did not know the full mind of Eru. Melkor and Manwë were the most powerful of the Ainur.
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. In the beginning of the Music, the Ainur were all in harmony with Eru and one another, but Melkor turned instead to his own pride, seeking power for himself and brought discord to the Great Music. He later continued to lead many of the Maiar astray as well.