A thermostat is a pretty simple device.
Most thermostats use a special type of thermometer called a bi-metal strip.
Bulb thermometers are good for measuring temperature accurately, but they are harder to use to control things. The bimetallic strip thermometer, because it is made of metal, is good at controlling things. The principle behind a bimetallic strip thermometer relies on the fact that different metals expand at different rates as they warm up. By bonding two different metals together you can make a simple electric controller that can withstand fairly high temperatures. This sort of controller is often found in ovens.