If heat is a measure of the mean kinetic energy of the particles of a substance, then how does compressing it increase its temperature, since compression squishes the particles of a substance closer together, theoretically limiting movement?
Because you cannot compress the substance without doing work on it. With a gas in a container, you compress by squeezing one wall further in. This wall is moving, and hitting gas particles, adding kinetic energy with each collision.
You’re thinking temperature, not heat. These are related but different.
The reason compression increases temperature is because the energy of the compressed gas is now more concentrated into a smaller volume, and thus the mean kinetic energy of the *volume* of the substance is higher because it occupies less volume with the same stuff.
Imagine hitting a baseball with a baseball bat. As the bat moves forward and hits it, the ball recoils going away faster than it was before: it gained kinetic energy from the bat. Contrariwise, if you bunt, so the bat is moving *away* from the ball, the ball slows down and loses kinetic energy.
Now think about a molecule striking the walls of a container. If the walls are moving inward, compressing the gas, the molecules will bounce off going faster than before, gaining kinetic energy — and thus temperature. And vice versa if the walls are moving outward.
I think the most important part everyone including OP is missing here is that we are absolutely not told whether the compression is isothermic, isobaric or adiabatic.
A gas will behave is totally different ways in all the 3 forms of compression.
Eg. Isothermic expansion maintains constant temperature throughout the compression making your question invalid.
The particles are always moving. By compressing the material (most noticable with gasses) the particles now have less room to move before they run into each other. Since the movement doesnt stop it just causes the particles to move faster over a smaller distance.