
Vapor compression is the most efficient means of providing cooling. The efficiency advantage over the thermoelectric approach is unequivocal in its superiority. See the figure for a schematic of how these systems work.

Starting at the exit to the compressor to the right of the schematic, the hot, high-temperature, high-pressure gas passes to the condenser unit. In the condenser, the refrigerants superheat is removed and the gas undergoes a high-pressure phase change from gas to liquid. Note that the high-pressure vapor converts to liquid without a change in temperature. The refrigerant releases its latent heat of condensation to ambient air and exits the condenser as a high-temperature high-pressure saturated liquid. At this point, the liquid passes through the expansion valve where it undergoes a pressure and temperature drop. The now 2-phase mixed gas/liquid is at low pressure and temperature. When this mixture enters the evaporator, it absorbs the heat from the component/system to be cooled. The low-pressure-temperature refrigerant absorbs energy without changing temperature as it changes phase from liquid to gas. At the exit to the evaporator the now low-temperature, low-pressure gas enters the compressor to complete the cycle.
Here is a pressure-volume diagram to illustrate what happens with the refrigerant going through the refrigeration cycle.

The power input to the compressor is mostly dissipated in the condenser along with the heat load from the item/system being cooled. By taking advantage of the physics of the various refrigerants, the power requirement is often much less than the cooling load. The proper refrigerant choice for the operating conditions is a key component in system design and its ultimate efficiency. This is how a system, building, or component can be maintained at a temperature below ambient. The heat is absorbed in the refrigerant in the evaporator and the compressor does the work to elevate the temperature and pressure. In the condenser, the heat is dissipated to the atmosphere at a high temperature, and in the expansion valve, the pressure is reduced to achieve the low temperature desired in the evaporator. Variations on this theme are directly used to cool air, a pumped liquid, or a cold plate.