On exactly the same principle as air conditioning in buildings and freezers, fridges, etc. (heat pump principle), only a smaller installation. The compressor is powered by a belt taking power off the crankshaft. I think this question has been asked before - have a look.