Usually in a termostat there is a little bulb filled with mercury or some other temperature sensitive stuff, when the set point is reached, the thing closes or opens a circuit and makes an arc. just like a motor, or the flipping of a switch

Rob