AC is only line of defense; don’t forget your reflexes and will can be targeted to do much worse things than just hurt you.
In Pathfinder 2e it is not true that rolling a 20 means an automatic hit. Rolling a 20 only automatically increases the degree of success by one. For example; if a character with +0 to their attack rolls a 19 versus an AC of 30 it results in a critical miss (19 is more than 10 below the target number). If they roll a 20 however it gets upgraded by one level and becomes a regular miss.









Of course, that was just for demonstration.
Though after a campaign has hit level ~8 or so it can be a fun reward to players to let them just squash a group of 1st level mooks as a kind of reminder of how far they’ve come since 1st level. At 9th level it’s reasonable to have +20 to your attack, and an NPC only has an AC of 10…