3e had that, and a table of demographics you rolled on to see what the highest level person of all classes, PC and NPC, was. Then there was simple pattern to determine the number of lower level people of each class. By default, most of the population was Commoner-1.
The demographics ultimately supported the insane levels of magic available in the magic item availability rules as written. As Tippyverse showed, the magic item economy was more restricted than the game RAW covered. Though one core conceit of the Tippyverse is the gods are hands-off, while most GMs of 3e said their gods would get upset over Tippyverse-like capers. Matter of fact, where do you think those ruins full of magic items came from?
5e hand waives that away with the "game is not an economy". I give the devs the fact that it's impossible to make a game that isn't abusable. Mainly because it is also impossible to make financial laws that someone can't abuse. (I give you the
"Double Irish with a Dutch Sandwich" tax cheat) but I would like some thing more thought out even if it nothing more than "these abuses offend gods of relevant domains, which is never a good idea."
I prefer some framework for providing the common competencies of non-adventurers. It could be something like a typical set of professions with the attack bonus and the value of their primary and secondary skills. Like, is a typical adult commoner +2/d4+0, +3, +1 while a royal bodyguard is +10/2d6+5, +8, +3, a royal advisor is +4/d6, +12/+4 and a king is +5/d8+2, +9, +4? This would have the king highy skilled & trained somewhat in combat for self defense but the bodyguard is a better brawler and the advisor is an Expert in their field.
You could even flip it around and use difficulty classes for primary/secondary. Commoners are Moderate/Easy, Seasoned professionals are Hard/Moderate, elites are Very Hard/Moderate and legendary figures are Nearly Impossible/Hard. Those correspond to skill modifiers of -5, +0, +5, +10, +15, +20 so you could either do opposed rolls or just use the standard DC.