Li Shenron
Legend
The number of levels could be lower or higher as well, there is really no ultimate perfect number for a RPG. I think they went with 20 in 5e only because the current edition wanted to use 3e as a starting point for a few things at least, including class format and spellcasting. They certainly didn't want to leave Wish or Meteor Swarm out.
There are 2 separate but correlated aspects to consider: level spacing and top abilities.
Which top abilities are included in the game is what really determines the kind of game you can play. It doesn't matter if you have 10 or 100 levels, it matters instead for example if the top spell for travelling is Misty Step or Astral Projection: that really has an impact on problem solving and therefore what kind of adventures you'll be playing. The stronger the top abilities, the harder the DM's job, but what is better for a designer between not offering an option at all vs offering an option that puts the burden on the DM to work properly? Is it better to have a game that "breaks down" at some point unless you're really a good DM, or a game that doesn't even let you try?
Level spacing is another matter and should be used to deliver a wanted feeling of advancement. Fewer levels have the advantage that they make levelling up a major achievement to celebrate. More levels better suit games with micro improvements. 5e designers wanted character abilities to be significant rather than fiddly bits, but at the same time too few levels would mean either too few abilities per character or too big bunches of abilities per level.
To get an idea, you can think what would happen if you granted 2 levels at once to your 5e PCs, so that you'd effectively start the game at 2nd, then 4th, 6th... 20th level, but "renamed" those levels to half their values so that players would think their PCs are levels 1-10 (incidentally you would get the benefit that spell level would now match character level!). I think the game would work just fine, but levelling up would be a much bigger deal, and would require more care for players to make on average twice as many character choices when levelling up.
There are 2 separate but correlated aspects to consider: level spacing and top abilities.
Which top abilities are included in the game is what really determines the kind of game you can play. It doesn't matter if you have 10 or 100 levels, it matters instead for example if the top spell for travelling is Misty Step or Astral Projection: that really has an impact on problem solving and therefore what kind of adventures you'll be playing. The stronger the top abilities, the harder the DM's job, but what is better for a designer between not offering an option at all vs offering an option that puts the burden on the DM to work properly? Is it better to have a game that "breaks down" at some point unless you're really a good DM, or a game that doesn't even let you try?
Level spacing is another matter and should be used to deliver a wanted feeling of advancement. Fewer levels have the advantage that they make levelling up a major achievement to celebrate. More levels better suit games with micro improvements. 5e designers wanted character abilities to be significant rather than fiddly bits, but at the same time too few levels would mean either too few abilities per character or too big bunches of abilities per level.
To get an idea, you can think what would happen if you granted 2 levels at once to your 5e PCs, so that you'd effectively start the game at 2nd, then 4th, 6th... 20th level, but "renamed" those levels to half their values so that players would think their PCs are levels 1-10 (incidentally you would get the benefit that spell level would now match character level!). I think the game would work just fine, but levelling up would be a much bigger deal, and would require more care for players to make on average twice as many character choices when levelling up.