How a Freezer Works
A freezer doesn't actually cool things, it removes the heat from them. You probably don't want a physics lesson but may wonder where the "cold" comes from. So here is a little bit more physics. When a gas goes from a state of high pressure to a state of low pressure, the temperature of the gas drops. Your freezer is circulating a gas from high pressure to low pressure over and over again.
Your freezer has a compressor and a closed system of tubing that contains a gas (the refrigerant). The compressor pumps the refrigerant and compresses it. The refrigerant flows through the coils on the back or under the freezer and through an expansion valve to the inside of the freezer. As the refrigerant passes through the expansion valve the pressure drops and so does temperature.
Inside the freezer a fan circulates air over the chilled tubing and the refrigerant absorbs the heat from the freezer's relatively warmer air. If you prefer to just think of the fan blowing cold air into the freezer, that's fine, it all works out to pretty much the same results. But technically, the heat is being pumped out rather than the cold being pumped in.
We've had a lot of questions about this, so here is an interesting note. If the temperature outside a refrigerator or freezer, is too low, the appliance will not cool efficiently. The appliance relies on there being warmer temperatures outside the appliance for the process to work. So if you keep a refrigerator or freezer in the garage and you are experiencing cold weather, your appliance will probably be too warm.
As the air in the freezer cools, the water in the air (humidity) condenses. Water that condenses in the freezer will freeze into frost. Most modern freezers have an automatic defroster which melts the build up of frost. The defroster is simply a heating element that is controlled by a defrost timer and a thermostat. The water from the melted frost drains out of the freezer into a pan beneath the freezer and evaporates.
Another thermostat activates the compressor whenever the temperature rises above a certain level. The level varies based upon the setting of the temperature control.
A door switch closes a circuit when the door is opened and turns on the interior light. When the door is open some freezers will disable some components such as the fan, defrost heater or "through the door" ice and water dispensing.