I worked out a great deal of these numbers many years ago when I was trying to take my primary campaign to new levels of depth. All of the numbers seemed supported by what the PHB and DMG both said and implied. While obviously critical and impactful they still left all the heavy lifting up to me. It made perfectly good sense to me that the unsung, unspecified NPCs would be important without being critical.
And I didn't like it. Let me explain why by describing what I like in my campaigns.
I personally think AD&D starts to break down above, oh, 8th-10th level. You can absolutely play above those levels but the margin of error gets smaller - the difference between the party strolling through unchallenged and a TPK gets more and more narrow each level past 8th, in my opinion. Sure, you can switch over to politics and intrigue, but this can be done 'away from the table' and the table can be reserved for lower-level play. This is why I like jazz band adventuring; you can keep it mixed up.
For these reasons I prefer game play to mainly be below 9th level.
I also strive to make magic special; some spells are hard or impossible to find, permanent magic items are far from common, and high-level casters are a Big Deal. But low level players with no magic items and very limited spells feel, well, cheated or slighted. A +1 sword is a big treasure to a 2nd level party and making limits too low can make the players feel unappreciated. This seems like a great fit for the 'other NPC' numbers where potions and scrolls are going to be relatively common but a sharp drop-off in quantity as power goes up. By placing the NPCs capable of making big items myself I can fine tune these levels the way I like.
Unfortunately, it negatively impacts my desire to have an active Good church as a unifying force that knits demi-humans together, especially humans, and help shield fragile humanity from the horrors from beyond the walls of reality that threaten them at every turn. After all, there are a ton of clerics and magic-users among gnomes, elves, etc. and humanoids likewise have a high number of shamans, witch-doctors, etc. I wanted a similar role in human kingdoms which meant that I needed a lot more clerics.
And while I want magic to be special I was struck by the idea that the vast majority of humanity would never encounter any kind of spell caster, especially arcane casters. Yes, I like and want 5th+ level magic-users to be impressive, but I also looked at European folktales that often depicted a minor wise woman or hedge wizard common enough that in an emergency a peasant could track one down. So I needed a lot more magic-users, too.
In other words, I wanted many more leveled NPCs without it increasing the amount of magic items in the campaign and without it making PCs less special.
One of the first things I tried was to greatly increase the number of 1st level NPCs and then have them 'drop off' faster. While I had originally used the 'adjust for location' entry in the DMG to mean that leveled NPCs naturally congregated in the places PCs look for them and, thus, were actually only 1 in 1,000 what if I just take the initial entry at face value and have 1 in 100? Suddenly the number of leveled NPCs shot up tenfold to 7,800! If we use the assumption that 50% are 1st level, 25% 2nd, etc., this would mean over 650 1st level magic-users and about the same number of 1st level clerics.
That would certainly give me the larger numbers of low level clerics and magic-users!
Unfortunately, it also means that there will be about 50 clerics and magic-users capable of making scrolls and potions! There will also be more clerics that can Raise Dead, more wizards that can cast Fireball, etc. While I get the low-level numbers I want this solution really wipes out the PCs as special - they won't stand out as special until, oh, 13th-15th level.
It would also give me a population of about 2,500 1st level fighters. That is a huge difference and, if they are employed, begs the question of 'why isn't the entire standing army made up of only 3rd level fighters?'. You also end up with enough higher level spell casters to have an 8th or 9th level magic-user AND cleric in every large town and a caster capable of making permanent items in every city. The massive 8.2 million person empire would be guaranteed to have an archmage, a high priest, and a handful of guys of even higher level, meaning that the world would have plenty of people capable of casting Wish every day.
When I first did that math I thought,
'From the little I know, that looks like Forgotten Realms.'
So what if we assume 50% are 1st level, 30% are 2nd, 15% are 3rd, and then the rest are spread out between 4th and 7th?
The big problems (thousands of fighters, too many spell casters) remain even though the PCs certainly do stand out much faster! While avoiding the 'there are plenty of guys making magic items' problem it makes the 'why isn't the army just all 3rd level?' a bit worse, actually. And we haven't even spoken of things like, oh, 343 paladins
What is to be done, if anything?
What I eventually did was to create a 'third way' of getting what I wanted.
What I did was - make some NPC-only classes. I certainly wasn't the first to do this but I don't personally know of anyone else who made NPC-only classes to solve these particular problems.
I approached the NPC classes from my needs and desires for the campaign. These included a desire to both increase the number of low-powered spell casters and avoid increasing the number of high-level spell casters, the number of magic-items/those who can make magic items, and all without reducing the impact of the PCs.
I also wanted to add in something between 'untrained peasant levy' and '1st level fighter'. I was always struck by the huge differences between 'some guy' and 'professional warrior' and the only thing in-between (mercenaries) look like 'some guy in armor'.
Lastly, I wanted to represent bandits, brigands, thugs, rakes, etc. as (like with fighters) more than 'some guy in leather armor'.
The NPC classes I made are;
Men-at-Arms ( in-between 0-level peasants and 1st level fighters) - maximum of 12th level or so
Religious Brothers or Sisters (the monks, nuns, parish priests, etc. that are religious without being clerics) - maximum level of 14th or so
Hedge Wizards (the local spell casters who can cast a few small spells but might not even be literate)
Scoundrels (tougher than a peasant, not as tough as a man-at-arms, often just dumb muscle)
These classes have limited spell power, combat power, etc. so that while tougher than a peasant they do not compare with player character classes.
But what frequency should they have from the general population? And how would that affect the number of NPCs with levels in 'PC classes' like paladin?
I figured this out by starting with one assumption and a particular goal.
The assumption is that of all NPCs with NPC classes 40% would be men-at-arms, 30% religious brothers, 20% hedge wizards, and 10% scoundrels.
The goal was to have enough religious brothers that about 80% of all villages would have a 1st, 2nd, or 3rd level religious brother as a parish priest. I wanted this to reflect a vaguely Southern France in the 1200's feel to the Church of the campaign.
Since there are about 1,250 villages in Seaward that means I need about 1,000 religious brothers from 1st through 3rd level. Those would represent 87.5% of all religious brothers who, themselves, were 30% of all NPCs with NPC classes in the kingdom. Therefore, 1 in 200 NPCs will have NPC classes.
This means that there are;
1,170 religious brothers
780 hedge wizards
This gives us about 1,020-1,025 religious brothers of 1st, 2nd, or 3rd level, exactly my goal.
Now, men-at-arms are no competition with full-fledged fighters, but if you look at the numbers with the 'standard assumptions' that means there is a single 11th level man-at-arms in the kingdom. What impact does this have? well, going through the entire 'let's roll x number of followers' is still perfectly valid, but what if, oh, 50% of these men-at-arms are the standing army? 700 or so 1st level men-at-arms with a few sergeants, lieutenants, etc., most of whom are also men-at-arms and then the rest can fill in all of those positions as bodyguards, caravan guards, etc. This can suddenly fill in a fair number of the gaps we had earlier. Now these roles aren't 'peasants with armor' without being 'a 1st level fighter watching a toll road'.
Religious brothers are parish priests, deacons, religious monks, nuns, etc. and are not fighters nor even healers until higher level. They will be doing their jobs, tending to the spiritual and personal needs of the common man throughout the kingdom. Ever wonder why clerics aren't giving sermons, converting pagans, or holding Mass? Well, it isn't their role, that is what religious brothers do. Clerics are, instead, much more like the fighting monks they are meant to be.
Hedge wizards are not the powerhouses of illusionists or magic-users, but they can make little trinkets and cast small spells. Even if the higher-level hedge wizards (and some low level ones!) all head to the towns and cities there are enough 'left over' to put one in about every other village, each making a living from small magic and good will, none ever able to cast Fireball or Conjure Elemental.
The scoundrels will be guarding illegal casinos, manning smuggler's boats, etc. relying upon their few meager hit points to earn a living.
In short, despite their higher numbers their reduced power does not overshadow the PCS or make magic items more common. Heck, they even answer a fair few questions from earlier work. The NPC classes made the background of my campaign much more coherent.
But what about NPCs with levels in PC classes? Do they 'go away'? Well, no - of course not. They just became much rarer. I used another assumption - NPCs with levels in PC classes should be at least 1/10th as common so I just made them 1 in every 2,500 NPCs. This gives us;
NPCs with levels in PC classes (1st level)
Fighters - 55
Clerics - 27
Magic-users - 26
Thieves - 20
Rangers - 7
Paladins - 6
Druids - 5
Illusionists - 5
Assassins - 4
Monks - 3
NPCs with levels in PC classes (5th)
Fighters - 7
Clerics - 4
Magic-users - 3
Thieves - 2
Ranger - 1
Paladin - 1
An illusionist or an assassin or a monk
The highest level NPC with PC classes you are going to see is going to be, oh, 9th level (and probably a fighter).
If you compare these lists to the ones I did with the initial assumptions the differences are - interesting. Overall the impact is that low level parties are just a touch less unusual but PCs become distinctive and powerful at 4th and 5th level, not 7th+. By introducing these four NPC-only classes I was able to create a campaign world where the average peasant knows someone who can cast (minor) spells - a local parish priest, or a hedge wizard - while powerful spells are more rare.
If you look at the discussion of standing armies there are more fun surprises - the standing forces become marginally tougher at the level of the individual soldier (and make human armies more on-par with humanoid forces in general) while making name-level fighters more rare.
Lastly, as DM I still have total control over the level and location of any NPC capable of making magic items. With these simple guidelines I can easily expand my campaign with just a handful of tools and be confident that it will not impact the power level or feel of my world.