There are two common types of air conditioners: evaporative coolers, and compressed air coolers. An evaporative cooler (also known as a swamp cooler or wet air cooler) is a device that cools air through the evaporation of water. In order to evaporate, a liquid must absorb some heat from the environment. Hence, the air coming from an evaporative cooler is cooler than the ambient air. Evaporative cooling is especially well suited for climates where the air is hot and humidity is low.
Compressed air coolers use the principle that a gas is compressible. Since temperature is dependent on molecules bumping together, a gas can be cooled by forcing it into a less dense state. So, you may notice that when compressed air is being forced through a nozzle, the nozzle can become quite cold. Compressed air coolers utilize this principle to cool air flowing through a heat exchanger.