at a higher temperature, particles move faster due to the increase in kinetic energy, leading to increased pressure. more frequent collisions will increase the force, increasing the pressure since pressure=force/area
if the volume of an object increases, pressure will decrease. because of the larger surface area, gas particles have more space to move around constantly and randomly, as well as less force on the surface due to less frequent collisions.
When they do stuff to piston:
To compress air, work is done against the force caused by the pressure of the air in the piston.
Doing work causes a transfer of energy to the internal energy and therefore kinetic energy
This increases the temperature of the air
Because the temperature of a gas is related to the avg energy in the kinetic energy stores of the gas molecules