The Silmarillion was a collection of world-generation notes by JRR Tolkien. Just like a modern passionate DM would do, he wrote many short stories about his own personal world inside of a journal. Most of it was incoherent and disorganized, as he wrote to it whenever whim took him in a writing mood. For the most part everything he wrote had strong christian influences, and many lines could be drawn between his own creation myth with that of Christianity's; makes sense since Tolkien himself was a Christian. You could easily say that Illuvatar was equivalent to God, and Melkor would be Satan (He's even described as being the most beautiful of the Valar!). Of course, Tolkien died before he could ever put any of this to a book, so his journal was stuffed into a box and forgotten.
But this was not the end of Tolkien's journal. Many years later, his son found the journal and decided to create a compilation of all the short stories. While there were many errors with timelines and such (Tolkien did not actually write it in any semblance of chronological order), his son made a great effort to organize it into the Silmarillion. It is widely considered a...difficult read to say the least and is very often considered very boring (because, as mentioned before, he died before he could assemble it into a coherent narrative). It's definitely written more like a collection of mythological tales like you might find for, say, Greek myths in a school library (only less accessible) than it is like a novel.
In A Nutshell
The Creation Myth
In the beginning, there was absolutely nothing. Then the god Illuvatar began singing. Of course this wasn't just any sort of singing, because to gods like him, singing was a means of weaving raw magic into a pure and physical form. He began his singing by creating his children, the Ainur, who in turn joined him in a new heavenly chorus. There were many Ainur, who were divided into the older and more powerful Valar, and the younger and less powerful Maiar. (Many better-known LOTR characters that are Maiar include Gandalf, Saruman, the Balrogs, and Sauron.) The Ainur each sang a different part of the world into existence, such as Ulmo who created the seas and oceans, and Aule who created the Dwarves, though they were flawed. Some time after Illuvatar found out and was displeased, as only he could make genuinely sapient creatures (that being the Elves and Men, who wouldn't be ready until the stars and sun were finished). Aule revealed he'd created them out of love for Illuvatar and to help the latter's creations, so Illuvatar infused Dwarves with the Secret Fire (true magic of life) to make them truly alive and fix the flaws.
Unfortunately, the First Dark Lord was also in this group. An Ainur by the name of Melkor; described as the most beautiful and gifted singer of all the Ainur, decided that he wanted to create his own song. At first he was simply an arrogant prick, as he hated collaboration and wanted something that was wholly his own creation. Twice in a row he tried this, and each time Illuvatar showed him a new, more beautiful song to both amaze the other Ainur, and show up Melkor. Melkor first created Fire, hot and cold. As a consequence of the creation of Fire, evil was introduced into the world, but also beauty was created as hot and cold made Weather. The second of his singing served to seat evil in the world by warping many creations, such as granting scorpions their tails. For this, Melkor was cast out of the Ainur's Chorus. Embittered and emboldened by his failure, he continued to desire the Secret Fire for himself; lacking the ability to create life on his own, he instead chose to infuse his own power into Arda, attempting to corrupt all of creation toward his will. As a result, his influence lingers even long after his eventual defeat.
The Valar that still wanted to control everything got sick of Melkor's shit after he destroyed the two lights they were using to keep Arda (the Earth) from being nothing but shades of grey with chest-high walls. These lamps blew up when Melkor knocked them over, and split the formerly continuous landmass into three separate continents. So they decided that if Morgoth was going to be a little bitch and destroy shit, they might as well turtle up in their own corner of the world. And so they went to Aman (the western continent), built two trees to be the lights, and got to work. Eventually they got around to making stars, and managed to install made Elves. Melkor gave no shits and purged them like insects. Eventually, the Valar beat his pussy ass up and brought him back as a captive (but not before he had a chance to corrupt some Elves, essentially turning them into Orcs. Maybe.). Elves were then drop kicked into Middle Earth(the central continent), and waltzed over to Aman in what was later to be dubbed "worst idea ever".
The Elves were working out really well, and and they became renowned smiths in their own right. Feanor, an elf king, made three awesome jewels called the Silmarils that glowed just like the two trees used to light up the place. However, fucking Melkor's decided to be a sneaky prick.He pretended to apologize to the Valar, and asked if he could see what they were working on. He immediately smote the two trees, killing them, and stole the Silmarils and fucked off to Middle-Earth to raid the elves there. He got his ass handed to him again, and holed up in the roguelike dungeon expansion pack Angband, due to his old Utumno version being too resource intensive. Then Melkor went on a crafting spree, creating beings such as werewolves, vampires and "balrogs" for any Maia who helped him and dragons, who for some reason took longer to make. He then spammed some Maia and gave the few who joined his group the gift of being "balrogs", while the first dragon - codenamed "Glaurung" - was successful enough to starttesting on his enemies. But Glaurung attacked Ard-galen too early due to Melkor being a fail, which alerted the Valar to Melkor's plans. Annoyed, Melkor managed to perfect Glaurung, and used him as the prototype to create more dragons. Once finished, he spawned an army of them to rampage across Middle-Earth before multiple factions joined forces and thwarted Melkor's army, in an event later known as the Battle of Unnumbered Tears.
Feanor was fukkin pissed, so much that it would make Angry Marines look like pussies, and kept calling Melkor "Morgoth." He was so pissed he picked a fight with another elf kingdom when they said "Dude, just chill". His sons would later pick up his teamkilling habits, the greedy little psychos. He traveled to Middle-Earth, played Angband over and over again trying to get his light-jewels back, and got himself killed. His elf kingdom stayed there, split between his sons, his half-brother, his half-brother's sons, his other half-brother's sons, and a king named Thingol who wasn't related to him. besieging and playing Angband for 400 years until Morgoth said "enough already!" and got those damn kids off his front lawn.
Meanwhile, back in Aman, the Valar hastily tried to replace the lost light tree thingies. This new 'sun' only works half the time, but it's better than nothing. (Also, the Silmaril backups got stolen so what're you gonna do?) Besides, the bloody elves really liked the stars and would've bitched for Eons if they got completely replaced. They also decided to create a watered down version of Elves called men.
Some of the Men got into Angband. Then the DM made a character for himself, named Beren, and started a romance with an elf king's daughter Luthien (the Dungeon-master's-girlfriend's character). Elf-dad Thingol was a racist shit, but that would look bad, so he said "sure you can date my daughter, IF you can finish a run of Angband by bringing a Silmaril jewel back to me." Beren and Luthien played together, almost got wrecked by a Maiar named Sauron (more on him later), but managed to pull it off. On the way back they encountered a werewolf named Carcharoth, so Luthien hit him with a sleep spell, and Beren tried to use the Simaril's light to fend the werewolf off when he woke up before the spell ended. Instead, Carcharoth bit off Beren's hand and swallowed it along with the Simaril, but touching Simarils is agonizing for anything evil (they gave Melkor scarred hands) so Carcharoth fled in agony. The wedding was on a Tuesday, and afterwards Beren led a raid to kill Carcharoth once and for all, as well as get the god damned Simaril back, which they accomplished. But Beren and some other guy got killed by Carcharoth's poison bite. Luthien later became an hero... but she sang some Goth poetry to the Grim Reaper-equivalent who, with Illuvatar's permission, gives them an extra life for finding the Simiaril, and they both live as mortals until they died a second time.
The rest of the elves were pretty sure that a Man and an Elf playing together was some kind of exploit, so they stopped being racist and actually treated each other well, even getting Dwarves in on the action. Unfortunately, Melkor was able to appeal to the inherent evil and greed of Men and got them to do all kinds of stupid shit. Still, not every Man was an idiot, some had great skill or wisdom, so the elves didn't go back to being totally racist. Some men picked up Morgoth's trollish habits and became his underlings, but there were also three bro-tier clans of men closely allied to the elves and fought on the frontlines of the siege, who were collectively known as the Edain.
Blah blah a Man named Turin leaves home, blah blah blah loses his memory and hooks up with his mind-wiped sister, blah blah defeats the dragon Summer Glaurung, totally not his fault he killed his best friend, totally not his fault he knocks up his own sister, when they both find out they become a heroic pair. This was expanded on in the book The Children of Hurin, published well after Tolkien himself died. It started with Turin's dad Hurin, who had the massive steel balls to tell Morgoth to fuck off to his face when the latter tried to get him to sell out a hidden elf city so Morgoth could purge them. Morgoth, like a GM angry no one wanted to play by his rules, cursed his whole family resulting in a story bleaker, but better than Game of Thrones. That's not a lie either, Turin goes through some hard shit in his life before he dies, his mother loses her home and her mind and Hurin is restrained "And I Must Scream" style and forced to see only the worst moments of his children lives. You thought the Starks had it tough? Think again!
Bro-tier Man named Tuor weds a hot elf shortie named Idril, after a Vala tells him how to get to the Elven version of Seattle, which is where the elves move to after the Angband MMO servers shut down and they lost all their kingdoms. They have a son they name Eärendil. Naturally, since this is a tragedy, Elf Seattle also falls when Eärendil's a kid, all because Idril's creepy cousin wanted to bone her. Again, incest is most definitely not wincest. Together with many other fleeing elves Eärendil ends up south in what was essentially a giant Elf refugee camp, since at this point Morgoth had fucked over nearly every other Elf realm further north. Tuor and Idril's kid Eärendil ends up dating Beren & Luthien's grandkid Elwing, who has a silmaril from her grandparents' adventures. Eärendil and Elwing end up with two kids, Elrond and Elros, but due to the way Eru wrote the code for souls and metaphysics the kids had to choose to be either elven or human. Later, some of Fëanor's sons, still wanting to reclaim their family bling, attack the Elf refugee camp because they know Elwing has it. Eärendil was out at sea while this happened, but Elwing threw herself into the ocean with the silmaril and transformed into a bird to escape, leaving her kids behind. It worked out though, because one of Fëanor's sons suddenly grew a conscience and decided to take care of them.
Eärendil, sick of how everything was getting steadily more grimdark, sails to the western continent with his wife to petition the Valar for aid. Moved, they break forth their wrath and smite down Morgoth. They smite him so hard that the continent they were playing on, Beleriand, broke and sank into the ocean. The remaining two silmarils were also brought out, and Feanor's two remaining sons saw their chance for an easy attack on Angband. They're told it's a bad idea, they have a quick discussion about whether they'll get banned for this, then raid the camp and pull off the quest, but when they try to use the silmarils they find they've become evil and, trying to hold the gems hurts them. The older brother Maedhros kills himself, while Maglor goes off to an unknown fate, finally bringing Feanor's kind to an end
Morgoth is currently forbidden from entering Middle Earth, though there's rumors that he'll eventually come back. There's also talk that this will happen when Illuvatar decide to rebuild the world and fix Morgoth's damage to the world, and then Morgoth will be defeated once and for all.
On the way back home from wrecking Melkor's shit, the Valar were impressed with three kingdoms of Men who joined the bro-quest to help elves, and gave them an island to play Numenor on, and gave them the title Dunedain with plenty of tech and weapon they could need. They easily defeated the Dark Lord Sauron, and patted themselves on the back because capturing Sauron was totally their idea. Sauron's a Maiar, so killing him is impossible, he just chilled in the dungeons, and told the Men how awesome they were even though they aren't elves... cause elves are immortal, but it's so great you can still do stuff with your disability. The Dunedain started getting into fad diets and buying life-extension supplements on home-shopping channels, which in a sick twist of irony, made their lifespans shorter. "Well, if I was a Valar, I could make men essentially immortal," said Sauron, and the Dunedain totally came up with the idea on their own to attack the Valar to demand immortality. "My old boss Melkor is a Valar, maybe he could help if he was free," and the Dunedain fell for that bullshit too.
So the Dunedain prepared their armies, and sailed west. The Valar and Elves knew they were getting a full-on invasion, and appealed to Iluvatar all-father to save their butts. Illuvatar agreed and went kamikaze on the invasion fleet, and made Middle-Earth round instead of flat, and sunk the island of Numenor like Atlantis for good measure. Sauron was still in jail when the place was rekt, and had to start over in Middle-Earth. Some Men of Numenor managed to survive, and washed up on Middle-Earth. They still had their abilties, and easily became kings among men. One of them started Gondor in the south.
The last story is about the gold rings. Sauron fooled people into thinking he was going change leaf, and made powerful magical objects for all his friends called "rings of power" (he actually did it before the Numenor mess. No way he could have pulled it off afterwards; after drowning with the island, he was resurrected without access to Disguise spells or his previous charisma). Each ring is actually a way to control the kings of men, dwarves and elves. He had a master Ring that could control all the others, hopefully to turn all the people of Middle-Earth into his personal slaves. The elven lords manage to isolate their rings, realizing their intent. The dwarf kings were partially immune, so while they didn't become Sauron's servante, the dwarves did get an extreme lust for gold and extra greediness, which made the dwarves go into sort-of isolation while they tried to fix the messes this caused. The kings of men were not immune, and became Sauron's dark servants, the Ring Wraiths, his most trusted servants.
The Elves and the survivors of Numenor got tired of Sauron's shit, teamed up and proceeded to wreck said shit. Just as the elves started thinking maybe not all Numenorians are greedy shits like the ones that tried to attack Aman, the king of Men Ilsidur decided the One Ring is too awesome to destroy after cutting it off from Sauron, and kept it for himself. Elves gave up on Men totally. Ilsidur himself died on the way home in a stupid horse accident, losing the One Ring.