Also worth noting that rolling a Natural 20 increases the level of success by one, and Natural 1 lowers the level of success by one. So most of the time a 20 is also a critical hit, but there are instances (like if a 20 would normally fail) where it only turns into a hit. The same with a natural one in the opposite direction, though there are things that key off critical failures rather than the GM just making things up.
It's a mechanic that is built into attacks and classes. There are spells where a critical success and a critical failure will add on new conditions (or subtract them), for example, or that the Fighter's math is built around them having a better chance to hit than most classes against the monster math, which also ends up meaning that they are more likely to critically hit.