A gas exerts pressure on the walls of the container. Why?
The molecules of a gas have very large kinetic energy.
When these molecules strike against the walls of containing vessel, they exert certain average force per unit area.
As the force per unit area is known as pressure, therefore
the gases exert pressure on the sides of the containing vessel.