Works just like the thermostat in your home. Set at desired temp and controls the heating element to stay at or near that set temperature. This is the single most important piece of husbandry equipment that any keeper should have.
Below are examples of thermostats in descending order from highest to lowest quality/reliability in my opinion. It’s worth it to shell out for the good equipment.