Why do gases heat up when compressed? I know that the collision rate between particles increases when they are compressed. But why does increase in collision rate increase heat?
From a macroscopic perspective, the work energy theorem/1st Law of Thermodynamics with $dW = P.dV$ solves your question.
In the microscopic perspective; the explanation is a little bit trickier. You generally compress a gas by moving the boundaries of the container the gas is stored in. Like moving a piston such that the gas has smaller volume. Now imagine a piston slowly compressing a gas, since the particles' masses are negligible compared to the piston, any collision between them can be approximated as elastic. So any atom colliding with the wall will have increased speed in the direction the wall is moving. With the collisions the extra energy is distributed to the rest of the particles. Hence, total energy, thus temperature increases.
Be careful. Heat refers to the transfer of energy between thermodynamical systems, and so it is not properly correct to say that a system has heat. A system has energy which can be transferred in form of heat, and you can also define the temperature, which is a sort of measure of the average kinetic energy of the constituents of the system, and the internal energy, the total energy possessed by the system.
Now lets answer the question(s). They are related but I think that there are some little but relevant details about the cause-effect relation.
First question, "Why do gases heat up when compressed?". Compressing the volume the collision rate between the particles grows for essentially two reasons. The first is the most straightforward: less volume, greater probability for the particles to scatter. The second is more involved: when compressing the system, there would be a certain amount of energy transferred from the moving walls to the particles hitting them, and this energy will therefore be shared to the other particles thanks to the collisions between them. Particle will have more kinetic energy and will move more quickly, so the rate of collisions will increase. Meanwhile, temperature and internal energy increase as well.
As regards the second question "But why does increase in collision rate increase heat?", provided heat to be replaced by temperature (or internal energy?), the answer is just a rephrasing of that above, but being careful with the relation cause-effect. If the collision rate is increased, then someone 1) squeezed the system (and ideally you could be able to do this without exchanging energy and keeping the temperature constant) or 2) gave, in some way, energy to the particles, increasing the thermal agitation and hence the temperature.