Many of the conveniences in the world around us wouldn't exist if it weren't for the discovery of refrigeration. Air-conditioning units make cool homes, vehicles and workplaces possible. Perishable food can survive long periods in shipping because of refrigerated trucks and boats.
The basic mechanism behind refrigeration involves heat energy being collected, and then moved from one area to another. A refrigeration device uses four basic components: an insulated area, a compressor, tubing and a gas.
Put it All Together
The compressor pressurizes gas inside part of the tubing located outside the insulation. The pressurized gas condenses, which makes the gas molecules release heat energy as the energy state lowers from gas to liquid. This heat energy is released outside of the insulation. The condensed liquid gets forced through a narrow neck of the tubing into a low-pressure environment inside the insulation. This increases its energy state to a gas, making it more prone to absorb heat energy from the insulated area.
In a refrigerator, heat energy from a recently added object, such as a new bottle of ketchup, transfers into the cooler air around it, making the ketchup cooler and the air warmer. The air then collides with the tubing, or something touching the tubing, transferring its heat energy to the gas inside the tubing. The gas is then forced back through the compressor into the high-pressure tubing, where it condenses and releases its heat energy, repeating the process.
Another Way to Look At It
When molecules have more heat energy, they vibrate faster. Pressurizing the gas makes it difficult for the molecules to hold heat energy because they have less room to vibrate, so heat energy is released. The tubing outside the insulation becomes hot as it releases all the heat energy. A fan may be added, as in a home air-conditioning unit, to blow cooler air across the heated tubing. Next the pressurized gas is forced inside the insulated area. In this low-pressure environment, the molecules have plenty of room to vibrate. So the gas takes in heat energy from the air and objects in the insulated area, before it's forced back into the compressor to restart the cycle.
The tubing starts from one end of the compressor, then narrows, expands to normal size again, and ends in the other end of the compressor (see diagram). The narrow neck maintains high pressure on the output side of the compressor, and low pressure on the intake side.
Refrigeration unites use certain gasses because of their ease in energy transfer and in changing between energy states. Chlorofluorocarbons (CFCs) used to be the main refrigerants, but as they're hazardous to the environment, newer gasses, hydrochlorofluorocarbons (HCFCs) and hydrofluorocarbons (HFCs), have been developed for the job, such as R-23 and R-422A.
The compressor pumps the gas though the tubing. It forces gas from one end of the tubing into the other, not allowing it to recede backwards into the former tube. Gas pressure builds up in one side as gas seeps through the narrow neck in the tubing into the low-pressure side. The compressor eventually sucks up that gas and cycles it back into the high-pressure side.
A refrigeration unit may have additional fans to blow air on the high-pressure side, the low-pressure side, or both. Air blowing across the tubing makes the transfer of heat quicker. A refrigerator may have a fan to blow air molecules across the objects inside it. As the air molecules collide with objects that have a higher level of heat energy, such as a bottle of soda that was just placed in the refrigerator, that heat energy transfers from the warmer object to the cooler air. The transfer is possible without a fan, but is faster with one. A refrigerator usually won't have a fan on the outside, but instead has a large heat sink. Naturally moving air collides with the heat sink to move the energy.
Insulation keeps the low-pressure area cool once heat energy has been removed from it. Insulating this area prevents heat energy from outside transferring in to reheat the area. Insulating a refrigerator keeps the heat energy-deprived air molecules inside, and the heat energy-rich air molecules out. A house's insulated walls act as the insulation for an air-conditioning unit, keeping cool in and heat out.