Gas molecules have momentum and move randomly inside the container when they collide with the walls of container the direction of motion is reversed and therefore due to change in momentum force is applied on the gas molecule and equal and opposite force is applied to the wall of container .