Joule–Thomson effect: why does temperature decrease during expansion When a gas under a high pressure in a piston (isolated from surrounding is allowed to pass through a valve), why does its temperature decrease once during expansion?

I haven't still studied thermodynamics but would like to know why exactly the temperature decreases.

Is it because under high pressure the heat was concentrated under small volume once expanded the heat is distributed?

Once the gas molecules are allowed to expand through the valve its kinetic energy increases. Where is the source of energy coming from, is it from its internal energy?
In order to expand, the molecules may do work, such as pushing against a piston, pushing against the container (as in water rockets), spinning a turbine, etc. Energy is transferred from molecular motion to another form, so the temperature drops.

In free expansion, however,


  the gas does no work and absorbs no heat, so the internal energy is conserved. Expanded in this manner, the temperature of an ideal gas would remain constant, but the temperature of a real gas may either increase or decrease, depending on the initial temperature and pressure.


[from Wikipedia].