Big picture: The universe goes through cycles, where the elder gods create new worlds including one “perfect” world full of anima then go to sleep on that world. After a while, they revert to egg like structures. After a longer while, they ‘hatch,’ consume all of the anima on that world, and proceed to destroy everything else in the universe and start over, much like toddlers playing with Legos.
In this current cycle, Gielinor (the game world) is the “perfect” world. There have been six ages, roughly defined as follows:
First age: Guthix arrives in Gielinor. He thinks “Hey, this place is pretty dope. I’m gonna bring a bunch of mortals here so they can live and be happy.” So he does. Gielinor now has people (humans, elves, etc.) on it. Many start worshipping Guthix, which he thinks is not dope. He kinda hates all gods and their very existence after a few destroyed his home world and killed his daughter, so he tells his followers to f**k off (nicely) and then takes a long nap, hoping they forget about him.
Second age: A whole bunch of other gods arrive on Gielinor. They think “Hey, this place is pretty dope. I’m gonna conquer it,” and start doing so. They bring other races (demons, vampyres, Mahjarrat, etc.) to help them conquer the planet. Zaros builds a giant empire, then he gets stabbed in the back and it falls apart. With the then strongest god out of the way, the other gods continue to try to conquer the planet, with Zamorak now in the mix.
Third age: Whoops, too many gods, not enough planet, time for a war. The gods are fighting each other mostly for possession of the Stone of Jas, a very powerful magic rock created by the elder gods to help them create other shit. Then, some gods created a sword capable of killing other gods, the aptly named “godsword,” but the bird people in charge of carrying it got ambushed and stuck in a frozen cave. Everyone else rushed in to try to get their own godsword, and now we have a god wars dungeon. Whoop de f**king do. Shit happened, Nex got unleashed then frozen again, then the entire area got frozen with all four major armies inside. The war finally ends when Zamorak uses the Stone of Jas to blow up Forinthry, creating what is now the wilderness. This wakes Guthix up, and now he’s pissed, so he kicks all the other gods out and permabans them with no appeal option. In the process he finds out that not everyone forgot about him, so he f**ks right back off to sleep.
Fourth age: With no more gods to muck everything up with their wars and magic rocks, mortal races start to actually get shit done. Most non-human civilizations are built during the fourth age. Towards the end of the age, humans discover their own magic rocks in the form of rune essence, inventing modern magic in the process. tl;dr: it’s all about the magic rocks.
Fifth age: A relatively short age. Even though gods can’t visit Gielinor they can still communicate with it, so reality has turned into a propaganda war, and Saradomin’s winning, by a lot. A bunch of human civilizations pop up, and Saradomin’s followers occasionally succeed in turning them into theocracies. In the process they turn out to be incredibly self-righteous, kick the black knights out of Falador, and blow up the wizards’ tower, but still end up being the good guys? Shit’s wack. The end of the fifth age, specifically year 169, is when the game actually starts. Some jackass adventurer pops up, starts killing things, commits vast amounts of deforestation and public endangerment, and basically just makes everyone’s lives miserable. He/she also saves the world multiple times and never actually dies though, so there’s not much that can really be done. The fifth age ends, however, when Sliske turns to social media instead of Jagex customer support to find that the gods’ ban can be overturned if he kills Guthix, so he does so, mostly for the lols. This is detailed in The World Wakes, which kicks off the sixth age.
Sixth age: Everything after The World Wakes. The gods are back, Guthix is dead, and the world is all around pretty f**ked. Saradomin and Zamorak get in a fight and nearly destroy Lumbridge, Armadyl kills Bandos, and Sliske’s a major pain in everyone’s ass up until he gets offed. At least he was having fun though. Anyways, where the story appears to be headed is the elder gods are starting to wake up, which will inevitably result in the destruction of the universe as we know it. And yes, that will probably bypass Immortality.