It is a hard concept to wrap your brain around, and you might need to play through it to get it.
The basic concept, is that the to hit number is generated using a 20 sided die simulator. The monster "rolls" 1d20 to hit you, and then adds it's to-hit bonuses. If the number that is generated is higher than your armor class, then your are hit.
Here is an example using some testing I did on an AC build, might not be completely accurate, but it is close:
If a monster has +43 to hit, like the dps types in Gianthold wilderness(the CR15 hobgoblins for example), then if they roll a 2 or higher they will hit an AC of 44 (1's always miss). That makes a AC of 43, 23 or 10 all get hit on a 2 by that monster.
There are other factors such as glancing blows, and positioning, etc. which make it not quite that simple....but in a nutshell you either have an AC that helps, or you don't. Wizards/Sorcs generally don't, they have Disaplcement and stoneskin to avoid taking damage.