My understanding of AC is that an enemy must roll higher than your AC to take any damage on you. However, if this is the case, wouldn't a player only need an AC higher than 20 to be invincible? I am level 1 and my AC is already 17 so even now I don't see how monsters can hit me very well. I am aware of monsters with bonuses to attack rolls, but are these the only monsters that can really hurt me?
It's d20 + attack bonus vs. AC, not just d20 vs. AC.
For example, the basic ogre in the Monster Manual makes attacks at +8. So that ogre can hit AC 20 on a 12 or higher.
Rolling a "natural 20" (i.e. the die itself comes up 20) is a hit regardless of AC, so opponents have at least a 5% chance of inflicting some damage on you. (Damage tends to scale with levels, though, so that level 1 goblin isn't a huge threat to a level 10 character even if he does get lucky and roll a 20.)
Beyond that, a lot of enemies will have special abilities — especially spells — that Armor Class doesn't protect against. So saving throws (Fortitude, Reflex, and Will) are just as important as AC for avoiding damage. At higher levels, magical effects that can straight-up nullify attacks also become very powerful.
If you're asking "I am aware of monsters with bonuses to attack rolls, but are these the only monsters..." then right here is the misunderstanding.
ALL the enemies will have an attack roll bonus. For the very, very weakest enemies (say, a single rat) the bonus will be +0, but that's an exception rather than the rule, usually all enemies appropriate for a starting lvl 1 party will have a combat bonus - so "the only monsters that can really hurt you" includes everyone.
The attack bonus of your enemies will scale up as you grow in level, and I believe their attack bonus would grow faster than your AC unless you heavily focus on AC - which might not be the best choice, as attack and the other defences are important, too.
That being said, in low levels against opponents that aren't magic/tricksters, a high AC would mean that you'll be getting hit rarely - but that's ok, you can't withstand many hits and you'll get multiple opponents, so having a 20% chance in every attack to get damage is enough to be dangerous/deadly/fun.
Four things you should consider are:
- You have to equal or exceed the target's AC for the attack to hit.
- Attack bonuses increase as monsters get stronger, from a combination of base attack bonus and strength/dexterity getting higher.
- There are circumstances when AC can be reduced, such as being prone, and when attack bonuses can increase, such as flanking. You can read about them here.
- Not all attacks are made against normal AC, some go against touch AC, and other times the target may be flat footed. And a lot of spells don't even care about AC, such as favorites like Fireball and Lightning Bolt.
So in conclusion, an AC of 20 does not make you invincible. To put this in perspective I am in an epic level campaign with a level 22 character who has an AC around 40 and I still get hit frequently by enemies such as Balors. The effectiveness of AC is relative to what you are fighting.
In D&D there are different times at which AC is effective. In the early game, between levels 1-10 or so AC can be a reliable way to avoid getting hit, after that point Monster To-Hit and other special abilities that avoid AC entirely begin to scale far past what an unoptimized character is capable of having. At that point its more cost effective to just buy some miss chance. Blur, Displacement, Mirror Image or something like that.
That being said no one attribute ever makes you Invulnerable, you could have infinite Armor Class and still be killed by level 1 wizards casting magic missile. You could have Infinite DR and still be burned to death. Infinite hit points and you can still be drowned to death.
All attacks have bonuses, and as you level up, those bonuses keep growing pretty much automatically. Early on in the game, you get a big chunk of AC for very little (your Dex mod, your armor and shield’s base AC), but getting more AC after that requires expensive magical items.
As a result, AC is actually quite weak: as you level up, you have to pay a lot of gold just to keep your AC relevant against enemies of your new level, who have higher attack bonuses just by virtue of being a higher level. If you can keep up, it’s fairly useful, but plenty of things can just ignore it, which means you are putting a lot of resources towards a defense a lot of things won’t care about.
Generally, the best strategy for AC is to take whatever you can get for cheap (the best armor you are proficient in, having a reasonable Dex score, casting basic spells like mage armor, whatever), and then not sink too many more resources in it.
While I'm not talking about touch AC (we're talking about invulnerability from "hitter" monsters, right?), your assumptions still do not hold up. I think the basic assumption we need to debunk here is that "some monsters have a bonus to their attack rolls".
Every creature in the D&D universe, be it a monster or a NPC with class levels, has a base attack bonus akin to the one the player have, tied to its HD. They often have a positive strenght or whichever ability influences their to-hit roll and they sometimes benefit from feats. They might get a size bonus (or a penalty, really, but this is often compensated by a lot of strenght) or be able to buff themselves with spells and/or spell-like abilities.
An enemy rolling to hit you very rarely has a +0 modifier to its attack rolls, and this is usually only true for low level monsters with a CR lower than 1 (which are supposed to swarm you and get some hit sooner or later, I suppose).
AC, however, plays an important role only until level 7~9-ish. Raising AC means spending a lot on money on it and to-hit rolls raise even without spending money there (because of BAB and monsters with better ability modifiers showing up), so AC becomes very easy to bypass if not specialized into (a thing only spellcasters can really afford), especially for high-HD monsters, buffed people and high BAB classes / racial HD.
In the meantime, other ways to harm characters show up, such as spells that requires Saves, spells that can only be stopped by Spell Resistance or even worse spells that hit the target no matter what.
Overall, high AC is not invulnerability.
You are right that AC is powerful, but as the other answers have said it's only powerful against one specific attack and there are ways to reduce the effectiveness of AC.
For example against a heavily armoured target switch to touch attacks. Vs a target with high dex scores try and make them lose their dex bonus...or you can flank for flanking bonuses, etc. As enemies increase in levels their attack bonuses and abilities that bypass armour all increase too.
As a level 1 character with AC 20 then most enemies you fight will have only a small chance to hit you, however if they do manage to hit you then you do not have many hit points to survive those hits.
By dedicating too much time to bolstering your AC you can actually reduce your defence against other things that matter just as much. AC 20 is no help at all if you are grappled and held to the floor, or if you fail a will save and start attacking friends, or if you fail a reflex save and fall into a pit trap, etc.
You can roll higher than 20 on a d20, if your bonuses are high enough. In fact, you have to do this to beat any DC higher than 20 (the natural-20-always-succeeds rule notwithstanding).
I put it this way because while it does in fact keep AC from making you invulnerable to physical attacks, it also affects many other aspects of the game. You probably won't face such high-DC rolls while you're still Level 1, but you'll start facing them soon enough.
Alex P's response explains the basic mechanic pretty well. Here are some additional considerations.
AC reduces resource drain. Resource management is a big part of every edition of D&D to date, and AC is crucial to this. Many players undervalue defense generally, and AC particularly, by overstating the "best defense is a good offense" axiom. For instance, martial-type characters often dismiss using shields because such reduce their gross damage output. There are a number of reasons why defense in general, and AC in particular, should not be so ignored, but one of the biggest is that it greatly reduces the rate at which healing resources are expended by a party. Hit points, healing effects (including spells and potions) are almost always expended resources (with a few generally very limited and/or expensive exceptions). By far the most commonly useful way to avoid damage is AC. In most situations, you can safely assume that the higher your AC is, the less frequently you will need to expend those healing resources.
For spellcasters, AC improves offense as well as defense. Because taking damage can interrupt casting a spell, thereby losing a precious offensive action, any individual who depends upon spellcasting for offense becomes dependent on good defenses. Albeit with exceptions, divine casters get better AC and other defenses than arcane casters, and this is an enormous edge (generally counterbalanced by weaker offensive spells). There are defenses other than AC, particularly the "miss chance" provided by concealment and certain magical effects. "Miss chance" is attractive because unlike AC it can't be overwhelmed by high attack bonuses, but a prepared opponent can generally overcome such defenses.
Keep in mind the different kinds of AC. Armor Class is indeed powerful, but often you have to be a bit more specific about it. There are two basic types of AC, "touch AC" (which generally comes from actively avoiding attacks) and "flat-footed AC" (which generally comes from passive protection). In most situations both contribute to defense but often one or the other will be bypassed. There are many situations where a low (total) AC character is better defended against a particular attack than a high (total) AC character.