After producing the desired cooling effect, the vapor is passed through a compressor where it is compressed into high pressure and high temperature vapor. The last step is converting the vapor back into a liquid, which is done outside the refrigerator where heat is dissipated into surroundings (atmosphere) and the vapor condenses back into liquid.
J.M. Smith, H. V. (2005). Introduction to Chemical Engineering Thermodynamics. New York: McGraw Hill.