A gas exerts pressure on the walls of its container because
The particles of a gas hit the walls of the 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.