Earth's atmosphere creates such a pressure (we call it atmospheric pressure), and it wants to push all atoms in the atmosphere apart from each other, and therefore into space. Gravity.
Is atmosphere a space?
There is no distinct boundary between the atmosphere and space, but an imaginary line about 62 miles (100 kilometers) from the surface, called the Karman line, is usually where scientists say atmosphere meets outer space. The troposphere is the layer closest to Earth's surface.
Why does the atmosphere not go into space?
The Short Answer:
Earth's gravity is strong enough to hold onto its atmosphere and keep it from drifting into space.