Mechanically, they are literally the worst class in the game. A level one commoner might as well be a level zero character; having bad save progression across the board, the BAB of the Wizard, D4 hit die, 2 skill points per level with a limited number of class skills, are proficient in only a single simple weapon, and have absolutely no class features whatsoever.
It's usually reserved for NPCs who don't qualify as any other class, as NPCs with actual jobs and trade skills are more likely to be Experts or Warriors. However, because most settings are backwater medieval fantasy worlds where education comes at a premium, it means that most of the everyday people that inhabit the setting are likely to be commoners. Commoners boil down to being a walking Profession or Craft check and that's pretty much all they ever need to do. Because of their abundance, they are likely to be the quickest followers to accumulate if a PC takes the Leadership feat, and due to their lack of features it is easy to stat lots of faceless, disposable minions en masse without having to get into the minutia of rolls, modifiers, and skill points.
Pathfinder "upgraded" them slightly by giving them D6 hit die (mostly since no class in Pathfinder has D4) and tried to make them a little bit interesting by having NPC classes grant "Boons" at appropriate occasions (determined by the GM), which often provide mechanical benefits to players; such as granting minor bonuses on certain skill checks or shopping discounts on certain craft skills. But most of the time they are just fluffy excuses to remember the character.
Needless to say they generally make awful adventurers, after all they will die to a mere House Cat... unless you use some Commoner only joke options from an April Fools section on Dragon Magazine. Who knew pulling chickens out of your pocket when you tried to grab something could be so broken?