Kinetic Molecular Theory
The ideal gas equation:
PV=nRT
Pis pressure.Vis volume.nis the quantity in moles.Ris an ideal gas constant.Tis (average) temperature in Kelvin.
Thus if we hold aspects constant, we can isolate variables. So if the quantity, constant, and temperature remain constant but the volume of the space decreases, then the pressure must increase. If the volume, quantity, and constant don’t change but the temperature goes up, then the pressure will also increase.
Don’t forget things break down a bit for non-ideal gasses, when the space being occupied is small relative to the number of particles or when the particles have significant attraction to each other.