An air conditioner uses chemicals that allow for the cooling of warm air, which makes it condense. Using that process over and over again allows the air conditioner to take the warm air outside, and the cold air inside. That's especially useful in summer!
Have a nice day! :)