The short answer
A thermostat measures the temperature where it is mounted, compares that reading with the temperature you set, and switches heating or cooling on or off. It does this with a low-voltage signal sent over control wires to the furnace or air conditioner. The thermostat doesn’t make heat or cold itself.
How it senses the temperature
Older thermostats often used a bimetal coil, which is two metals bonded together. As the temperature changes, the coil bends, and that movement opens or closes a switch. Many modern thermostats use an electronic temperature sensor, often a thermistor, whose electrical resistance changes with temperature. A small processor reads the sensor and decides what to do.
How it sends the signal
When the thermostat calls for heat, it connects the 24-volt R wire to the W wire. The furnace’s control board sees that signal and starts its heating sequence, which typically includes checks and steps before the burners light and the blower runs. For cooling, the thermostat connects R to Y, which starts the compressor in the air conditioner or heat pump. A connection to G runs the fan on its own.
Why it doesn’t switch at the exact setting
Thermostats don’t usually switch at the exact temperature you set. Most allow the temperature to drift a little on either side before they change state. This small band, often called the differential, helps prevent rapid on-and-off switching. Some thermostats let you adjust it.
Older mercury switch thermostats
Some older thermostats use a small glass tube containing mercury as the switch. Don’t break these. Take them to a hazardous waste site or a recycler that accepts mercury products, and follow local rules.
Why the wiring has letters
Each function needs its own wire, which is why thermostat wiring is labeled with letters such as R, W, Y and G. For the full list of letters and what they do, see furnace wires explained. If you are replacing a unit, see how to wire up a 3 wire thermostat for the connections step by step.