Firearms hit all sorts of issue in terms of how they were designed and how they were balanced. Unfortunately paizo decided to go a route that suited their campaign setting more then them being a good set of rules.
Basically paizo tried to drive a sports car, from the back seat, by alternately pulling and yanking on a series of levers. The end result, the car goes mostly in the desired direction, and mostly faster then most cars, but theres lots of room to go wrong, and the path it takes is a friggan mess.
First big problem: having the rules for firearms support the Golarian specific fact that they are rare and mostly don't leave alkenstar. So they are expensive as hell, and they need specific knowledge (read class abilities like quick clear and reloading feats/abilities) to operate effectively. Sure firearms are expensive to manufacture, but so were good swords in their day, and crossbows could malfunction and jam. It was foolish to make them different then every other weapon for campaign setting reasons. One lever pulled the sports car swerves wildly right.
Now you have outrageously expensive, prone to failure, slow to load weapons. What do you do? You have to give them something. So the insane solution was to make them not just go through armor, but be actual touch attacks. Neglecting the fact that huge amounts of monsters rely on natural armor almost exclusively. Another lever pulled, the sports car goes into a left skid, back tires burning up rubber.
On top of that now, we have a gunslinger. A class specifically designed to use these overly expensive unwieldy, but also game breaking weapons. So that class has in built exceptions to a lot of the rules nonsense that go around firearms. Because the class needs to be able to do its thing, which is shoot guns. But of course there is still the possibility for non gunslingers to use firearms. So somehow they have to figure out a way to make it work with both the limitations of the weapons bypassed (via classes/archetypes that are supposed to use them) but still be somewhat reasonable for a normal character to use them.
You have now thrown the sports car into an uncontrollable spin.
The sad thing is, paizo had a perfectly solid set of rules for firearms. They wrote them. In the pre-pathfinder version of their campaign setting. But they decided to go with the touch attack, slow to reload idea that literally does not fit mathematically into the rest of the game, make them overpriced and prone to failure, then create a class that bypasses those issues and hope it all evens out.
Most gunslingers will be average characters. If you don't optimize the crap out of it, it works well enough. Their damage isn't as high as a highly optimized archer most of the time. But in specific circumstances, they are either way too good (abnormally high AC but low touch ac enemies) or downright aweful (campaigns without the resources or time for the gunslinger to keep up his ammunition count, or improve his weapon over time).