how does a low voltage thermostat work?

Thermostats have a thermal device that moves in response to temperature, often these are bimetallic metals. This expansion controls switch points.

Another type of switch is electronic, which has a thermal detector which causes a current which is amplified and triggers any number of electrical switching devices.