How does air conditioner work

The work  of air conditioner is based on the refrigerant phase transition from one state to another. Absorbing heat the refrigerant changes from  liquid to  gas and enters the compressor. When compressed the refrigerant changes from gas to  liquid and produces  heat. Outdoor fan of the evaporator cooling the evaporator with the airflow gets rid of excess heat. Freon is ready to change from  liquid to gasagain, the indoor evaporator fan cools it and being evaporated  it  is ready to take the heat. The process is repeated