If you define "realism" as "not making the reader notice the hand of the writer (however artfully done) in the limit," there's no way to do it except making them a dime a dozen, and that even if you make leveling much harder than it is in game. The idea that a party of adventurers can fight through six encounters in a day, and hit second level, but a shepherd can fight off wolves two or three times every winter for decades, or a caravan guard fight an encounter every month, again for decades, without leveling zeroth level -- well, you can fudge up reasons why the party can do it and the commoners can, but they are fudged up. (Their ability scores aren't that much better.)
I have read an argument that not all priests can be cleric-class because then 2.5% of the population would be clerics, and if all the classes claimed an equal representation (not an axiom I would put weight on, but grant it for argument), then 30% of the population would be leveled. To which I say, Henry VIII made it law that every man between the age of 15 to 60 years old should have a bow and arrows for it, and practice. If women can do the same in a D&D world, they would, or the kingdom would be overrun by the one where the women were thus trained. And in your typical D&D world, most of them would have a chance to use that.
And, of course, the classes would not be evenly distributed. Fighter would probably be commonest, but cleric would be close after.