Yeah AD&D didn't really have NPC classes for the most part (Dragon magazine had a few). Like a Sage? 8HD NPC with some magical abilities in the 1eDMG. 2e had a lot of "0-level" NPC's, but they didn't make much sense, given how the proficiency system worked (which they claimed was optional, but treated like a default). If you're a master weaponsmith, for example, you need 3 non-weapon proficiency slots for baseline proficiency, and obviously, you'd need more slots to be very good at your craft.
PC's only got a few of these (3-4 at level one depending on class, and an additional one every 3-4 levels). High Intelligence characters could be allowed to use some of their languages for more slots, but there was no provision for how many 0-level characters got or how they could earn more- the DM just had to assign them what they needed.
About class levels in 5e, I probably should have titled the thread better, I try to use HD as a metric for NPC's, since 5e wants to use monster stat blocks for all NPC's. This made me come to a realization that my answer might be staring me in the face: looking at the Monster Manual NPC's, I see the Archmage, who is an 18 HD arcane caster (CR 12), with resistance to damage from spells and non-magic weapons (plus advantage on spell and magic saves). The most powerful non-caster NPC is the Gladiator, at 15 HD (but only CR 5?).
So Hit Dice seem to be rather arbitrarily assigned, presumably to get the hit point totals desired as opposed to being any real metric of overall power level. I could try to infer relative power level, that is, an Archmage is equal in power to a 12th-level PC, but that doesn't really mean anything. I'm still left with, how many CR 12s exist in the game? And the answer is "as many as a campaign needs".