Bimetallic Coil Thermostats
Although new AC thermostats are digital, there are still many older, coil thermostats still in use. These thermostats are made of what is called a bimetallic strip--two strips of metal attached to each other. Metals expand when they heat and contract when they cool, but different thermostats expand and contract at different rates. This causes the coil to change shape as the temperature changes, uncoiling as it heats up and coiling as it cools.
Older AC thermostats were controlled by mercury switches--special electric switches which turned on when they are tipped over. A mercury switch is basically a small glass tube with a bead of mercury and two electrical contact points inside of it. When the coil expanded enough, the end would bump into a mercury switch, turning it over. This switch would turn on the air conditioner, cooling the house. The AC would stay on until the house cooled enough to shrink the coil, moving it away from the switch and turning off the AC.
New AC thermostats are usually digital. A current inside the thermostat runs through a thermistor--an electric element which resists the flow of electricity in proportion to the temperature. The hotter it is, the more the thermistor resists the current. The thermostat measures the electric resistance and uses that to calculate the temperature. It then compares it to a stored temperature which the user sets. If the temperature in the thermistor is hotter than the user AC temperature, the system turns on.
Some window AC units have systems which control how cold the air is and how much air blows through. These aren't really thermostats--they don't actually monitor and control the air temperature--but they are often referred to as thermostats. Usually, these systems have a fan switch which controls how fast the fan is. This switch will usually have different resistors in each position. If it is turned all the way on, there will be little resistance, and the electricity will flow full force through the fan, turning it all the way up. If it is in the middle or low position, more resistance will be added to the circuit, and less electricity will flow to the fan.
The cold switch works in a similar way. If it is turned all the way up, the heat exchanger runs at full force, cooling the air as much as possible. If it is turned down, the heat exchanger will run slower, and the air coming through won't be quite as cold.