What keeps the air pressure on Earth?

I searched for the answer but it just says there s a thin layer above the Earth s surface . I m wanting more than that, like about the invisible force of magnetism or some gravitational theory?
12 answers 12