One of the coolest spells implemented in a video game was Armageddon, in Ultima 6. The description: "Once it is cast, it destroys all life on the world, with exception of the spellcaster, leaving only a barren wasteland behind, devoid of any life." If you cast it, every creature in the world would, indeed, die. You could wander around and pick up all the treasure you wanted. Obviously, at this point, the game was unwinnable and, indeed, pointless.*
I suspect that the spell was in there as a sort of nuclear-holocaust cautionary fable. But such fables have a place in post-apocalyptic games like D&D. Something happened to all those dungeon-building civilizations. Maybe they cast Armageddon.
D&D's 9 spell levels have always called out to be rounded up to an even 10. The problem is, with wish a 9th-level spell, what is there left to wish for? Let's slot Armageddon, and other big, dangerous, world-altering spells in here: spells that fuse the Prime Material with another plane of your choice, spells that sink continents, spells of apotheosis, spells that scry on Cthulhu, scrolls of genocide.
Extrapolating from the wizard spell chart, you'd get access to 10th level spells at level 19 (pretty close to the level cap in some editions). In D&D campaign worlds, there are no existing 10th level spells to learn: they've been expunged from every ancient library. (If any hints of their existence exist, they are in incomplete and obscure form, like the scientific learning in A Canticle for Leibowitz.) Generally, a civilization can't research such powerful spells until they have a greater academic understanding of magic than exists in standard D&D campaigns. Peaceful golden ages lead to such academic advancements. Academic advancements lead to 10th level spells. 10th level spells lead to Armageddon.
Given that this cycle has probably happened multiple times in the campaign world's history, there's probably a conservative, anti-intellectual secret cult that seeks to save the world by spreading chaos, toppling golden ages, and assassinating saints and sages, and they're right about everything.
* Ultima 6 also has a big in-game library, in the Lycaeum. If someone develops an eyeglasses mod, we can re-create episode 8 of the Twilight Zone.