Why do gases exert pressure on the wall of the container?

Because the gases have freely moving molecules present in it.
As they move at a certain speed in the container, They clashe with the inner walls of the container...
As a result it applies a certain amount of pressure on its walls.