The molecules of a gas are in a state of random motion. They continuously collide against the walls of the container. During each collision, momentum is transferred to the walls of the container. The pressure exerted by the gas is due to the continuous collision of the molecules against the walls of the container.
Due to this continuous collision, the walls experience a continuous force which is equal to the total momentum imparted to the walls per second. The force experienced per unit area of the walls of the container determines the pressure exerted by the gas.
Fig: Pressure Exerted by a Gas