Compressing a gas makes the gas denser, but it also causes the gas to heat up. Now, with a refrigerant gas, if you remove sufficient heat from the dense gas, it turns into a liquid. Why? A scientific principle called The First Law of Stuff That You Will Never Understand, So Just Accept It. As it turns out, just because you remove enough heat to turn a dense gas into a liquid, it doesn’t mean the liquid is cool. Quite the contrary; the liquid line is quite hot to the touch (you can verify this by touching the smaller diameter aluminum tube that runs along the top of the passenger-side fender well).
Now if you decrease the pressure of the liquid, it expands back into a gas. Something magical happens in the transformation from a liquid to a gas: The gas is cold. This is due to the Second Law of That Stuff Up There In the Previous Paragraph. My M.E. guru friend speaks in terms of "the heat of vaporization". The concept of the heat of anything making something cold gives me a headache, so I prefer to accept it as magic.
The three keys are:
Compressing the gas takes a lot of energy but the condensation, expansion and evaporation operations are free (or nearly free). Air flowing through a "radiator" removes enough heat to condense the hot gas into a liquid. Spraying the pressurized liquid through a small orifice causes a pressure drop, which evaporates the liquid back into a gas.
There's MORE? Oh, goody! Who cares?!