
We all have one of these! It is a splendid modern convenience and is an example of a heat pump— a device that moves heat, in this case, to ensure that my IPA is an acceptable cold temperature (being English I would also drink it warm). How does it work?
The case is simply an insulated box, so the heat cannot get in (remember that heat flows from hot to cold, so it would not be correct to say insulation keeps the cold in). At the back, there is a heat exchanger, a coil where the heat from inside the refrigerator can be dissipated—yes, this means that in the summer your refrigerator is pumping out heat which you are removing with the air conditioner (silly, isn't it!) But as heat flows from hot to cold, how did we manage to get it to flow the other way? We used a heat pump, to which we give energy so we can move heat; this is achieved because of the properties of the refrigerant (the liquid/gas that flows in the pipes) and the use of the compressor. The refrigerant will be a liquid with a low boiling point. Thus, we can easily convert refrigerant from the liquid phase into the gas phase.
To do this can require a great deal of energy, but, in this case, we already have the energy in place, the heat inside the refrigerator. Pumping in the liquid refrigerant and allowing it to expand and form a gas will cool the inside (this phase change can absorb a great deal of energy). Then, we can pump it through the coils and exchange the heat with the room. Unfortunately, the gas is not at a very high temperature, and so, the heat exchange does not work well, UNLESS we concentrate the heat in the gas, which we can do with the compressor. This will compress (pressurize) the gas so the heat is concentrated (the temperature is increased by the compression step), and thus the heat exchange will be more efficient. The coils at the back of the refrigerator will be enough to cool the gas down so it will turn back into a liquid, and the process can be repeated. The compressor operates only when it is needed.

Unfortunately, one of the best refrigerants was CFCs, (which stands for chlorofluorocarbons). This inert chemical managed to survive very long times in the atmosphere, reaching very high elevations where it reacted with the ozone layer (in the troposphere), causing the ozone hole(s). More on that in a later lesson, but if you cannot wait, The Ozone Layer Protection (EPA) website will give you the rundown. To prevent the release of CFC's we have moved to other chemicals that are safer: hydrochlorofluorocarbons (HCFCs) and hydrofluorocarbons (HFCs). HCFCs also contribute to the destruction of stratospheric ozone, but to a much lesser extent than CFCs.
You'll learn more about this when we get to Geothermal heat pumps (see the helpful animations there where the heat exchange is with the outside/inside of a house rather than from the inside to the outside of the fridge).