An air compressor is a device that converts power (usually from an electric motor or an engine) into kinetic energy by compressing and pressurizing air, which, on command, can be released for use elsewhere.
Often the compression takes place in two stages.
The process of compression produces energy which is manifested as heat. The heat is removed before use (or further compression), hence the introduction of intercoolers and aftercoolers
More detailed information about inter coolers can be seen at What is an intercooler? & What is an aftercooler?
There is some debate about the name; “intercooler”. Does it mean a cooler between two separate cooling stages (low pressure & high pressure) OR between the compressor and the unit requiring the compressed air?
It does not really matter – intercooler or aftercooler, the technology is the same. Both are required to cool pressurized air using a secondary medium (often water).
It is quite surprising how hot air will get when it is pressurized. Think of your bicycle tyre pump and the way it gets warm as you inflate your tyres, then multiply it 10 or 20 times.
There is a nice simple explanation here (https://www.physicsforums.com/threads/why-does-temperature-rise-with-pressure.39446/)
Temperatures well in excess of 200°C are not uncommon. Just from a handling perspective, this is not optimal. Very often, the process itself cannot use such hot air. Imagine the air at the auto shop at 200°C when you check you tyre pressure!
There is a nice explanation here: https://en.wikipedia.org/wiki/Air_compressor