Virtually all the time it really doesn't matter what levels and classes the people in a settlement have. But occasionally you have to defend a town or a village, or might even attack one yourself. And then it comes really handy to have a quick reference chart of some sort to generate those numbers quickly.
The old DMG had tables to get a comprehensive list of every single person in a settlement, but that is way too much work. If I need spellcasters to help with something, I'd like to be able to make a quick peek at a table and know "there will be about two 5th level clerics, eight 3rd level clerics, and 12 1st level clerics in this town".
Anyone seen anything like this, or made it?
My advice is not to get the locals involved if at all possible. Wars in pathfinder, much like wars in 3.5 are solved by heroes and anti-heroes, not by armies. Even assuming a very small percentage of the population are Spellcasters, a single level 5 wizard with a wand of fireball could lay waste to most any peasant militia without even breaking a sweat. Probably have a decent chance against a king's muster as well, though I'd imagine there would be casters amongst said muster so more of a challenge.
Having said that, what you get depends entirely on way too many factors including local terrain (steppe areas will get you more light horsemen, and archers, plains would favor spear/pike with archer and cavalry support if the area is wealthy enough etc), the inherent wealth in the area (armored militia versus a bunch of peasants handed spears and told to stand in a line), martial tradition (would have an affect on training and morale of said militia units), local availability of metal, food, and other war materiel. This is one of those questions that essentially must be done on a case by case basis for realistic results. On the other hand a quick and dirty method is 1% of the locals are trained warriors that serve as full time guards, and in times of dire needs every male between the ages of 14-60 can be handed a long-spear.
1% is about right for a standing army, 10% of population would not be unreasonable for a sustained drafted militia force anything more than that and logistics become difficult.
Although context is always important for example in a society where the entire population was expected to provide a certain necessary term of service in the army you'd probably start them all off at level 1-3 warriors(probably 66 22 12 ish for the split between 1 2 and 3, with 1/10 being a member of the standing army and therefore 3-5 and with pc levels, 1/10 of those being commanders in the range of 5-8 and 1 general/leader figure in the 8-11 range.
Also there's the question of who is fighting and where they're fighting because if a city is under siege you could have most of the population of men in the age groups of 13-40 serving in some capacity either as fighters or message runners etc.
Assuming this all takes place in a medieval world, a peasant rabble. Pathfinder is anything 'but' a medieval world though. Basically do what sounds right to you. Is your campaign world 'more epic' and 'high magic'? Throw in more heroic npcs. If anything, I'd go by DRS3's advice and let the 'locals' fight be the backdrop for the PCs actions. The fewer rules you have to use for that backdrop, the better :)
PF isn't a system that's good for mass combat or strategical warfare.