How can gas from compressed air can "take" heat from surrounding environment? I have recently been reading about why a can of compressed air gets cold when the air it contains is discharged. From what I understand the change from a liquid to a gas requires energy and therefore heat is drawn from the surrounding environment.
What confuses me is how the phase change sucks up heat? If energy is required to complete the phase change wouldn't that mean that the phase change would not take place unless heat was added? I guess I am confused as to how the phase change extracts the heat from the surrounding environment.
If I wanted to compress a gas into a liquid I would have to use force or my own energy to accomplish this, yet when going from liquid to gas the energy is just taken from the surrounding environment. This is confusing to me.
 A: In general, when a physical system is free to change, the system will tend to change its state so as to minimize the free energy.  It's a principle. For example, remove a dam from a river and the water from the lake behind the dam spontaneously flows down the canyon. No need to do additional work to 'push' the water down. The energy to flow around small obstacles on the way down comes from gravitational potential energy.
Temperature arises from the kinetic energy of the motion of molecules. If a gas is contained in a small container, and the container is opened into a larger volume, the gas molecules spontaneously move to occupy the larger volume.  If the expanding gas does some work, the energy for this work comes from the kinetic energy. The expanding gas might do work against the side of the container (i.e. a piston) or against attractive intermolecular forces (i.e. a real gas.) The decrease in kinetic energy of the system is sensed as a decrease in temperature. Reversible expansion of an ideal-gas which does no work is isothermal.  
The molecules in a liquid stick together and form a liquid because of inter-molecular forces between the molecules. Work is done against these forces to increase the distance between molecules and form the gas phase. This work decreases the kinetic energy, and the temperature decreases.   
