system
Given the following post, respond as if you're commenting on Reddit:
human
ELI5: How do refrigerators, coolers/cooler rooms and freezers work?

They are powered by electricity (obviously) and sometimes the back of a fridge is warm. But what is going on inside that makes the temperature inside the fridge/cooler cold? Thanks!
gpt
Refrigeration works on the rule that turning a liquid to a gas sucks up heat, and turning a gas to a liquid releases heat. An example of the first is that wearing wet clothing makes you cold. This is because your body heat is being sucked up to turn liquid water into water vapor.

In a refrigerator or freezer, this happens inside a pipe, with a chemical that boils at a much lower temperature than water. As it passes through the inside of the refrigerator, it turns from liquid to gas and sucks up heat. Then, outside the refrigerator, the compressor uses electricity to squeeze the gas back into a liquid, which releases heat. Then it gets pumped back through the inside, and so on.

If you have a large space, like a walk-in freezer, or air conditioning in your house, air is circulated over the pipes to get the heat sucked out of it, and then the cold air is blown around inside the space.