This is generally how your fridge works, and also the method KryoTech uses to cool its computer systems to -40 degrees Celcius in order to highly overclock them.

Very basically it's taking advantage of the fact that phase change of a liquid to a gas consumes a lot of energy (ie. thermal heat), and since gas needs a larger volume than liquid, you compress this gas back to fluid so that it can consume heat for turning into gas again. Neato, eh?