In J R R Tolkien’s legendarium, Eru Iluvatar, who had the secret fire of creation within him, created the earth or Ea, as it was called. To dwell on it, he created Elves and Men; the firstborn and the followers. The creation of Ea was achieved through a song, in the making of this song, eru himself took part along with his Ainur, these Ainur he created from the different parts of his brain. This song decided the themes of the Ea and after the song was finished, eru showed the Ainur the vision of the earth and sent some of these Ainur to earth to make it just like they had seen it in the vision.
The Ainur sent to earth were called the Valar, the most knowledgeable and powerful among them was Melkor and the wisest among them was Manwe Sulimo, who was chosen the king. Now the creation of these Ainur is interesting, they represented different aspects of the mind of Eru, though the most powerful and sharp in mind was Melkor, he alone among the Valar knew fear while Manwe could never understand evil and none of the Valar knew sympathy. When the making of the ea began, Melkor turned evil and started destroying everything the Valar made and the ea was never fully formed like the Ainur had seen it in the vision. Now the firstborn, the elves, started roaming in the middle earth and Melkor had made his stronghold here and he was aware of the awakening of the Elves before the news of it could reach the Valar in the west in the land of Aman.
It is told that Melkor used to spend most of his time in solitude even when the Valar lived with eru, he would often wander alone into the void searching for the secret fire of life but could not find it as the fire was within eru. There was only death in the void. When he failed to find the fire of creation, then the desire must have arisen in the heart of Melkor to rule the children of eru and become the lord of the earth. In the early history of elves, mentions of the shadows moving in the dark are found.
It was said that if the elves wandered far and in small companies, the shadows would capture them and bring them to the dark lord. Since he could not create life, this is how Melkor created the race of orcs, by torturing and mutilating the elves with cruelty and sorcery. And through this device more species far more dangerous than the orcs, were created by Melkor, who was named Morgoth by the elves, meaning the dark enemy of the world. Greatest among them were Dragons and Balrogs, greatest among the dragons were Glaurung (the father of all dragons) and Ancalagon the Black (the largest dragon in the history of literature). The Balrogs were of the race of the Maiar, Sauron and Gandalf were a part of this race.