Explain why the molecules of gas exert a force on the walls of the container.
According to Newton's third law, the wall must apply a force on the molecules in opposite direction. Molecules change direction and velocity. Newton's second law states a net force causes a change in velocity/time.