It's pretty much like this:
1.) Liquid fluid turns to vapor state. This heat transfer cools the air since the energy is being transferred to the fluid.
2.) Compressor/condensor compresses vaporized stuff back into liquid state. The heat is released and the fluid does it's thing again. (go back to step 1)
I'm no engineer or scientist so those who are can clarify or correct my words but that's basically it.
Easy as pie.
h: