exbm t1_j18uzsj wrote

The way this was explained in HVAC/refrigeration school was a typical refrigerant cycle deals with two phases of matter liquid and gas. When a material changes phase from liquid to gas it requires extra energy to complete the change. The molecule will absorb that energy from the surrounding area. This is called latent heat (heat is energy). This lack of energy makes everything cold. Because cold is really the absence of energy.

The reason you compress the gas on the high side is because in a gas temperature and pressure correspond. Increasing the pressure of the gas increases it's temperature. By increasing the temperature to higher than ambient air you allow the latent heat to to flow into the ambient air. Heat/energy flows from hot to cold. Like water flows downhill. Once this latent heat has been absorbed into the ambient air the gas will phase change back to a liquid. Now you can slowly let the liquid back in the lowside of the cycle for it to be evaporated.

Source: AS in environmental control technology