The refrigeration cycle is a heat engine operating in reverse, known as a phase change heat pump. Using a refrigerant which boils at a low temperature produces a relative coldness, lowering the temperature of the refrigerator to a level which prevents bacteria from multiplying and ruining food. A refrigeration cycle works on essentially the same principle that makes your hand feel cold when water is evaporating off of it. Other liquids, including some known as refrigerants, produce even lower temperatures when they evaporate.
The refrigeration cycle is a closed loop of gas which undergoes four stages. The first stage is the compressor, which compresses the refrigerant to increase its temperature. The gas is then routed through heat dissipation coils which release heat outside the refrigerator. As it dissipates heat, the refrigerant cools and recondenses into a liquid. This liquid then passes through a high-pressure/low-pressure threshold, called an expansion valve, which causes it to expand and change phases into a gas. The cold gas circulates into the refrigerator again, absorbing heat from the inside, before being routed into the compressor again. The purpose of the refrigeration cycle is to take heat from the inside of the refrigerator and transfer it to the outside.