Ranged Combat functions similarly to melee combat in many regards. Making a ranged attack is a Standard Action, and you use your Attack Roll to check against a target’s Armor Class to determine if you hit or not. As far as the Attack Roll goes, the biggest difference is that Dexterity contributes to the roll by default, rather than Strength, although Strength may still influence the damage rolls of some ranged weapons.
The most obvious difference between melee combat and ranged combat is… well, the range, of course. While characters armed with most melee weapons can attack creatures five feet away (and hence they threaten that much area around themselves), ranged weapons have the ability to deal damage at a considerably greater distance. This distance is somewhat reduced in Pathfinder: Kingmaker as compared to table-top versions of the game.
Unlike melee weapons, ranged weapons are slower, more deliberate, and hence a character with a ranged weapon doesn’t actually threaten any areas - they simply can’t respond to lapses in an enemy’s defense as quickly as an adjacent melee character could. This means that characters armed with ranged weapons cannot normally make Attacks of Opportunity or flank enemies. They can, however, perform Sneak Attacks on enemies who are vulnerable, so long as they’re within thirty feet of the target.
Not only are ranged weapons incapable of taking advantage of opportunities the way that melee weapons can, their use in melee combat constitutes such a vulnerability. Firing a ranged weapon - be it a bow, crossbow, or performing a Ranged Touch Attack with a spell - provokes an Attack of Opportunity. That’s not the only complication when it comes to mixing ranged combat with melee combat, however, as it can be hard to hit your target in the chaotic shuffle that is a proper melee. When shooting at a character engaged in melee combat you take a -4 penalty to your Attack Rolls. This penalty can be negated with the Precise Shot feat, which in turn requires Point-Blank Shot.