A saving throw represent the chance to avoid an unusual or magical attack. The mechanics is very similar to the one of an attack roll:
1d20 + base save bonus + ability modifier
The base save bonus is based on the classes the character has levels in, as well as on the number of levels. The DC depends on the attack itself (e.g., if it's a saving throw from a spell, the spell's DC is used).
A natural 20 on 1d20 always means success, while a natural 1 is always a failure. In the latter case, if the effect could harm objects too, it damages the exposed ones.