The Ainulindalë is the first part of The Silmarillion and describes the creation of the world by Ilúvatar and the realization—or in some cases, destruction—of his vision by the Ainur.
The Ainur were made first by Ilúvatar, and they include both the Valar and the lesser Maiar. To the Ainur, Ilúvatar spoke of a great theme of music out of which the world would be formed, and each Ainu sang his or her part, in harmony with the others and yet also expressing the unique knowledge he or she had been given by Ilúvatar.
Of the Ainur, the most powerful was Melkor, and more than the others, he sought to bring things to being in the Void, and he often went there alone, seeking the power to do so. While he did not find this power, he did find a bit of independent thought, and when he sought to weave this into the music, it became discordant, and many of the Ainur were dismayed and stopped the music or began to sing along with Melkor. Ilúvatar ordered the music to change to a new theme, but Melkor—ever ready with his wrench to throw into the cogs—refused to relinquish his own version of the song, and the music changed a third time to the third theme, which is credited with inspiring the creation of Elves and Men.
When Melkor sought to overtake the music a third time, Ilúvatar ordered it stopped, and it was told that even the destruction that Melkor had woven into the music would later contribute to the glory of the world.
Melkor, needless to say, was not made happy by this.
The music of the Ainur shaped the world, and the Ainur saw at last the purpose of their music beyond its beauty and a vision of what the world might become, and Ilúvatar gave leave for those who wished to shape the world as it was in their visions to go down into it. Many of the mightiest Ainur, including Melkor, went forth into the world, and its creation became their purpose and their powers are contained within it.
Over many ages, the Ainur shaped the darkness and chaos into the world into which Elves and Men would be born. Here we meet the chiefs of the Valar—Manwë, Ulmo, and Aulë— who reign over the winds, waters, and earth, respectively, and of course Melkor. Being the most powerful, Melkor desired the world for his own but was overcome by the other Valar. Melkor then turned his powers to destruction of what the Valar wrought, but he was unsuccessful, and the world came into being.