Why does a gas exert pressure on the walls of the container?
Particles of gas hit the walls of container.
In gaseous state, the particles move randomly. So, sometimes they hit each other and the walls of the container. The pressure exerted by the gas is because of the force exerted by the gas particles on the walls of the container.