As heat leaves, the food compartment gets colder. Meanwhile, the gaseous refrigerant is being warmed. The warmed gas is then cycled to the compressor. The compressor is a mechanical device that pressurizes the warm gaseous refrigerant. The compressor pressurizes the warm gas and makes it hot.
Pressure is proportional to temperature.
The hot gas is cycled to the condenser. The condenser is a collection of heat-exchanging tubes at the back of the refrigerator. The hot condenser gives off heat to the warm kitchen. The gas turns to liquid as it loses its heat to the kitchen. Heat moves from warm areas to cool areas.