In order to have an air cooling system in a vehicle, it needs to have a way to remove heat from the air reaching the occupants. Most of these systems, be it in a car or a building, rely on thermal transfer and the temperature changes which occur as pressure changes. AC compressors are the component that builds up the pressure, which increases the heat of the refrigerant.
Without compressing refrigerant, the air conditioning system would only be able to cool down the vehicle's occupants if the air inside was hotter than the air outside, and even then, it would be a slow process.
The AC compressor turns on and off as needed, in order to save fuel and power when not in use. It will also cycle on and off automatically, depending on how much cooling is desired compared to how hot the outside air is.
Typical Power Source
Most vehicles have the AC compressor attached to the engine so that it can be part of the serpentine belt system. Because the belt is always being driven, these compressors use a magnetic clutch pulley that allows the belt to feely spin the pulley when the compressor isn't needed.
Alternative Power Sources
Some vehicles use an electric AC compressor that is turned on and off as needed. These are typically found on electric cars and some hybrid models.
Pictured above is an AC Delco brand AC replacement compressor for a 2005 Pontiac GTO. It currently has a cover over the inlet and outlet ports (top right, clear-ish colorless plastic) to prevent moisture from getting into and corroding the internal components, and should only be removed to install.
The blue component up and left from the center is the plug for the magnetic clutch circuit connector.