The following image is a schematic of a refrigeration cycle. It is described in detail below, so you may want to go back and forth between the diagram and the description.
Mechanical refrigerators have four basic elements: an evaporator, a compressor, a condenser, and a refrigerant flow control (expansion valve). A refrigerant circulates among the four elements changing from liquid to gas and back to liquid.
In the evaporator, the liquid refrigerant evaporates (boils) under reduced pressure and in doing so absorbs latent heat of vaporization and cools the surroundings. The evaporator is at the lowest temperature in the system and heat flows to it. This heat is used to vaporize the refrigerant. The temperature at which this occurs is a function of the pressure on the refrigerant: for example if ammonia is the refrigerant, at -18oC the ammonia pressure required is 1.1 kg/sq. cm. The part of the process described thus far is the useful part of the refrigeration cycle; the remainder of the process is necessary only so that the refrigerant may be returned to the evaporator to continue the cycle.
The refrigerant vapour is sucked into a compressor, a pump that increases the pressure and then exhausts it at a higher pressure to the condenser. For ammonia, this is approx. 10 kg/sq. cm. To complete the cycle, the refrigerant must be condensed back to liquid and in doing this it gives up its latent heat of vaporization to some cooling medium such as water or air. The condensing temperature of ammonia is 29oC, so that cooling water at about 21oC could be used. In home refrigerators, the compressed gas (not ammonia) is sent through the pipes at the back, which are cooled by circulating air around them. Often fins are added to these tubes to increase the cooling area. The gas had to be compressed so that it could be condensed at these higher temperatures, using free cooling from water or air.
The refrigerant is now ready to enter the evaporator to be used again. It passes through an expansion valve to enter into the region of lower pressure, which causes it to boil and absorb more heat from the load. By adjusting the high and low pressures, the condensing and evaporating temperatures can be adjusted as required.