Not sure if it's completely accurate, but this is the impression I've gathered:
Ifrit, in his hatred of humans, tried to eliminate them. I think he summoned the meteor that you see traces of all over Lucis, and that's why there are a bunch of references about how the shards still burn after all this time. The meteor gave rise to the starscourge, a daemon infection that spread across the population. (the only evidence I've seen of this was from a book in the game that described "ash-like particles" that seem to block sunlight and spread the scourge)
Ardyn Lucis Caelum was chosen by the other Gods to cure the scourge, and he did so by taking the infection into his own body to cleanse the people. Unhappy with his methods, the Gods turned against him, forbidding him from entering the afterlife and crowning a new chosen one, Izunia, who usurped Ardyn's name. Ardyn, in his bitterness, then chose to work with Ifrit to spread the scourge until the day that the "True King," Noctis, would rise to fight against him. There, he would end the Lucis line, or if killed, would finally have peace. In the end, he achieved both.
Apologies if that made no sense. I tried.