The compressor is nothing more than a pump. It compresses the refrigerant, due to a metering device in the evaporator, the pressure of the gas increases. Remember using a hand pump to pump up you bicycle tires? The pump and hose got warm, even the tire although not that noticeably. The hot high pressure gas is condensed into a liquid by the condenser coil, thus releasing the heat outside which the refrigerant gained inside.