Melkor began the First War before Arda even took shape, having the upper hand until Tulkas the Strongcame from the Far Heaven to the Little Kingdom, his wrath and laughter driving Melkor away from Arda into the outer darkness and earning special hatred. Tulkas remained, becoming one of the Valar of Arda.
Melkor brooded, learning of the Valar through his friends and spies among the Maiar whom he had converted to his cause. He heard that they brought order to seas and lands, Yavanna planting the first seeds, and the fires of Melkor being subdued. This caused a need for new, less violent light to nurture the seeds, so the Valar raised the twin lamps of Illuin and Ormal creating a changeless day. Plants grew mightily, animals came and dwelt there. No flower nor bird song was yet present. So with this great victory and work accomplished, Manwe ordered a feast of celebration, and allowed rest, and at that time Tulkas espoused Nessa.
Melkor, jealous of his peers, planned to subjugate them to himself. So he gathered spirits from the halls of Ea, the ones whom he had perverted, and he came in a form dark as the night of the Void because of his hatred. But the Valar could not see his shadow because of the light of Illuin between them and because they feared no evil. Melkor built his underground fortress of Utumno beneath mountains to which the light of Illuin barely reached. His hatred flowed out from there, darkening, poisoning, and mutating Arda, but also revealing him to the Valar.
Melkor attacked the lamps, breaking them. The giant pillars crashing onto Arda were catastrophe enough, breaking lands and causing tumultous seas. But the spilling light burned over the earth. The first designs for Arda made by the Valar were destroyed and never regained.
In this horrible confusion, Melkor escaped, though fear came over him, the only Vala to truly know fear, as above him he heard the roaring seas of Ulmo, the mighty wind of the voice of Manwe and the footsteps of Tulkas. But Melkor hid deep in Utumno, while the Valar used most of their strength to restrain the disasters occurring upon the earth. After that, they feared that if they rent the earth in search of Melkor, they would destroy the Children of Iluvatar whose sleeping location none knew save Eru. Thus Melkor ended the Spring of Arda and destroyed Almaren, the dwelling place of the Valar in Middle-earth.
The Valar departed Middle-earth, going to the westernmost land of Aman which looked upon the Outer Sea, called by elves "Ekkaia", which encircled Arda. They fortified their dwelling and made great mansions, and made their domain in that region, called Valinor, more beautiful even than Middle-earth in the Spring of Arda, blessed, and the deathless dwelt there. No flower faded, nor was there sickness or corruption, even the stones and water being hallowed. Yavanna made the Two Trees of Valinor: Telperion and Laurelin, known also by many other names. The trees gave cyclical light of gold and silver, causing the beginning of the Count of Time. The light falling from them like dew was collected by Varda into shining lakes that gave to all the land of the Valar both water and light.
But Middle-earth had only the twilight from Varda's early stars wrought in the time of Ea. In that near-darkness, Melkor sometimes left the utter darkness and walked abroad in powerful, frightening shapes using cold and fire, doing acts of cruelty, violence, and death. For the Valar were concerned with giving their care and love mostly to their own new land.
Manwe, however, did not forget Middle-earth and thought on it, watching it and sending his spirits as hawks and eagles over it to bring news. Their eyes saw to the bottom of the seas and into the caverns. Yet neither Manwe nor his servants could see into the darkness created by the dark thought of Melkor.
Ulmo too, remembered Middle-earth, his waters taking his power and spirits even under the darkness of Melkor so that the earth did not die, and the people of Middle-earth could be heard by him through the waters. He will never forsake Middle-earth.
Yavanna sometimes went to Middle-earth to mend the hurts to her beloved works and, on her return, to plead for war. She set a sleep on many of her creations, to awaken in some better day. The oldest living things had already arisen, which probably includes Fangorn and perhaps other beings more enigmatic.
Orome, tamer of beasts, sometimes hunted with spear and bow the monsters plaguing Middle-earth while riding great, silver Nahar, first and greatest of horses. Orome sounded his horns, the Valaroma, made for him by Salmar, causing evil shadows to flee and Melkor to quail even deep in Utumno. But they returned after Orome left. So Melkor, when the Firstborn wakened, gave them fearsome rumors of the Hunter who would catch any of them not in large groups, so that they feared Orome at first meeting.
Aule made many great and beautiful things, but thought also of the great mystery of the Children of Iluvatar, and created dwarves as his best guess at what they would be like. These were only lifeless robots. Then he feared that he had done evil in Eru's sight, and started to destroy them in atonement. Amazingly, the dwarves cowered away from him as no robot would. Eru spoke, saying that he had adopted the dwarves and given them life, but they must be made to sleep until a more proper time as the elves were to be the Firstborn. To this Aule agreed, and the dwarves say that he cares for them even after death and that those first dwarves, such as Durin, continue to reincarnate in their descendents.
Melkor did not sleep, but worked hard. His perverted spirits walked abroad, as did the monsters he had caused from that which already existed. In Utumno, he gathered Maiar balrogs, "the spirits who first adhered to him in the days of his splendour, and became like him in his corruption: their hearts were of fire, but they were cloaked in darkness, and terror went before them; they had whips of flame." Melkor bred many other monsters of various shapes that would long trouble the world. His realm spread southward.
To resist any attack from Aman, he made a fortress and armoury near the north-western shores, commanded by his lieutenant, Sauron, and named it Angband.
The Valar called a Council, in which Yavanna and Tulkas called for war. At Manwe's bidding, Mandos warned that the Firstborn would awaken but it would be a while yet. They realized a war could destroy the tiny unknown place where the elves slept. When they awoke, they would be in darkness looking first upon the stars, and therefore calling on Varda at time of need. After hearing this, Varda took that time to accomplish the greatest of the works of the Valar since their coming into Arda, taking the silver dews from the vat lakes she had collected from Telperion and made new, brighter stars for the Firstborn. The ancient stars were too dim alone, so she gathered them into constellations which held meaning. The constellation Valacirca was the Sickle of the Valar, sign of Doom, and challenge to Melkor. Elves later on were known to sing to greet its rising, defying Melkor in that fashion.
The elves awakened, and saw these stars, the magic of the starlight going into their eyes so that they glowed. Melkor was first of the Valar to locate them, and set a fear of Orome upon them. He sent shadows and evil spirits to spy upon and waylay those who left the group, and the elves sung of the dark Rider who pursued them to death. Either Melkor actually sent out dark riders or but had the tale whispered. This could have been a bit of old mythology that the Nine Black Riders could draw upon to add to their fearsomeness. In either case, the elves feared Orome the Hunter when at last they met. For Orome found them from their singing, and loved them. The elves who had the courage to remain saw that he was of light, and not of evil, drawing the noblest to him. But the elves who were ensnared by Melkor, it is said by the wise of Eressea, were imprisoned in Utumno, "and by slow arts of cruelty were corrupted and enslaved; and thus did Melkor breed the hideous race of Orcs...." The Orcs loathed and feared Melkor, "maker only of their misery". This was the deed of Melkor most hateful to Eru.
Then did Manwe call for war, as Eru told him it was now time, to save the elves from Melkor. This caused grievous destruction to Arda, even thought the Valar did the battle swiftly. Melkor hated the elves, since he knew the Valar had come against him for love of them.
The gates of Utumno were at last broken and the hall unroofed. Melkor hid in the deepest pit, but Tulkas stood as the Valars' champion and wrestled him, throwing him down on his face, and chained him with Angainor which Aule had made, making Melkor captive, brought before Manwe blindfolded, bound hand and foot. Peace came for a long time.
But many of his evil creatures escaped, and Sauron they did not find.
The bound Melkor pleaded before Manwe, but was sent to the inescapable Halls of Mandos for three ages, before he could plead again.
But the worry that his actions put into the minds of the Valar caused them to make one of their greatest mistakes. In Council, they debated the fate of the elves. Ulmo led those who wanted the elves to remain free in Middle-earth and mend its hurts. But those who prevailed feared harm that could come to them in such a dangerous world, and desired the company of these beautiful new beings. They called the elves to come out of Middle-earth to live with them "safely" in Aman.
Part of the elves, the Avari, the "Unwilling", preferred to remain under the starlight, causing a sundering of the kindreds into the Avari and the Eldar. Of the Eldar, many, mostly relatives of the Teleri, did not go the full distance and relocated in Arda, and were called the Umanyar. All those who did not make it to Aman, whether Avari or Umanyar, were called Moriquendi, "Elves of the Darkness" or "dark elves", for they did not see the Light that was before the Sun and Moon.
The Caliquendi, "Elves of the Light", passed into the uttermost West. They were also known as the Eldalie and were of three groups. The Teleri, "Sea elves", also called Falmari for their singing, were the greatest in number and stopped on the shore of Aman itself. The Noldor, "Deep Elves", the people of Finwe, loved craftsmanship and were the friends of Aule. The smallest host, led by Ingwe, most high lord of the elvish race, was first to follow Orome, and never returned to Middle-earth. They were the beloved of Manwe and Varda, the Vanyar, "Fair Elves", and were almost never seen of men.
But Melkor broke even this supposed safety, for many of the elves of Aman left it later, following the Noldo Feanor, with a terrible oath to find the released Morgoth and the silmarils and to gain vengeance.
For Melkor, after his long imprisonment in the Halls of Mandos, pleaded with Manwe and gained his freedom, but as Mandos knew, had not really changed in his heart. In time Melkor once again began heinous deeds, protected from the Valar by their fear of destroying the peoples of Arda and by the constraint of Feanor's oath invoking Eru Iluvatar.
Earendil's arrival in Valinor, bringing back a silmaril, and pleading the cause of both Man and Elf, ended the Oath's hold over the Valar.
Morgoth, as an angry Feanor had renamed Melkor, was captured by the other Valar with the aid of the Maiar, and cast into the Void. Even then, his influence reached into Arda and his deeds continued with the aid of his right hand, Sauron.
Melkor will not be completely stopped until the Last Battle. Only after that will the Song of Eru be sung aright with the voices of all peoples, and Arda be made beautiful as it was foreplanned.