Compressed air is a simple tool but with complex issues. Air can be compressed and used to make jobs easier by moving product such as sugar, applying paint, or in tools for a shop. The complexity is the process which air goes through before it is used.
Air is normally spread out with minimum pressure and temperature while having a large volume. When air goes through a compressor the pressure is increased and the volume drops drastically. Temperature is increased greatly through kinetic friction between the molecules being pressed into a small volume. To explain take a gander at the ideal gas law.
The gas constant, R will remain the same since air is the only substance being examined. Newton’s Third Law states that for every reaction there is an equal and opposite reaction.
As the pressure increases, due to the compressor, the temperature also rises. The volume is decreased through the compression process and normally having the number of molecules, n, stay the same but in a small volume would change the state of the air to a condensate or liquid form but the temperature is so high that the air remains in a gaseous form.
When the air is released into a receiver or into the pipeline the temperature will gradually decrease and that is when the gaseous air begins to change and condensate/water is introduced into your compressed air system.