When air is compressed, the molecules of air are forced closer together, which causes them to move faster and collide with each other more frequently. This increased kinetic energy of the molecules results in a higher temperature. The amount of temperature increase depends on the amount of compression.