Armor Class represents how hard it is to land a damaging strike in combat, and a variety of factors play into determining Armor Class. A character's size, Dexterity, bonuses from equipment (armor, shields and other, usually magically-enchanted, items) and circumstance modifiers all affect their Armor Class. For most characters, their Armor Class is largely determined via the following formula: 10 + Size Modifier + Armor Bonus + Shield Bonus + Dexterity Modifier + Other Bonuses.
A character's Armor Bonus and Dexterity Modifier are often at odds, and it's rare for a character to have a significant bonus from both. Armor hinders movement, including both movement speed and mobility required to dodge. The heavier the armor, the better the Armor Bonus, but the more restrictive it is. This is represented by a Max Dexterity rating each armor has, and generally there's rarely a good reason to wear armor that doesn't allow you to apply most (ideally all) of your Dexterity Modifier to your Armor Class. Tower Shields and encumbrance can also reduce the amount of Dexterity you can apply to your Armor Class.
In addition to the aforementioned bonuses to Armor Class you have Deflection Bonuses (typically gained from spells, or Rings of Protection and similar gear), Dodge Bonuses (typically gained from feats) and Natural Bonuses (monsters tend to have this but humanoid characters from playable races will have to use magical items like Amulets of Natural Armor and spells to replicate these bonuses), among others. Bonuses of the same type typically do not stack - the highest bonus is applied to your Armor Class and any other, lower bonuses are ignored.
Touch Armor Class
In combat, a character's Armor Class is opposed by an attacking character's Attack Roll. If the attacker's Attack Roll meets or exceeds a target's Armor Class, they'll hit with whatever spell, melee or ranged attack they're attempting. Not all attacks are equal, however, sometimes (typically with spells) merely touching the target is enough - the bulkiness of their armor, thickness of their hide, nor size of their shield impede such attacks for both Touch Attacks or Ranged Touch Attacks. The Touch Armor Class formula is as follows: 10 + Size Modifier + Dexterity Modifier + Other Bonuses.
Flat-Footed Armor Class
Also, on the first round of combat before a character takes their turn, they are considered Flat-Footed. Flat-Footed characters are susceptible to Sneak Attacks, cannot make Attacks of Opportunity, and do not gain the Dexterity Bonus to Armor Class. Whether a character is considered Flat-Footed or not is almost entirely dependent on their Initiative Roll at the beginning of combat. If their Initiative Roll is higher than an opponent's, the opponent is considered Flat-Footed on the first round, otherwise, the character in question is Flat-Footed. The Flat-Footed Armor Class formula is as follows: 10 + Size Modifier + Armor Bonus + Shield Bonus + Other Bonuses.
Applicable Class Modifiers by Situation
|Creature Size||Modifier to Attack and Armor Class|
Includes Dwarves, Gnomes and Halflings
Includes Elves, Half-Elves, Half-Orcs and Humans
|Defender's Condition||Armor Class Modifier|
The defender also loses their Dexterity Bonus to Armor Class in addition to any Armor Class penalties listed.