Pressure in gases is due to collisions of molecules with the walls on the container. If a container is closed and left to stand, it will not collapse because the air molecules in the container exert an outward pressure equal to that of the atmospheric pressure acting on the container. Upon impact the force exerted by the air molecule on the wall is equal and opposite to the force exerted by the wall on the molecule (Newton’s Third Law of Motion). The collisions produce a force on the container walls . The force per unit area is the pressure. Therefore, the pressure of a gas is due to the collisions of gas molecules with the walls on the container.
Pressure-volume (p-V) relationship of gas
The pressure of a fixed amount of gas is inversely proportional to the volume of the gas when the temperature is constant.
When the volume of a container is decreased by half, the number of molecules per unit volume will be doubled. This would mean that the number of collisions of the molecules with the walls will also be doubled. Therefore, the pressure will double. If the volume were to decrease by one-third the pressure would increase by three times the original. Therefore, the pressure is inversely proportional to volume.