When a gas is compressed, its volume usually decreases which also causes an increase in temperature. The pressure in addition increases which causes and increase of gas molecules. The molecules collide more frequently which is the reason why temperature will increase.