You can feel for yourself that the atmosphere gets thinner as you go higher above the earth. If you drive or hike to the top of a mountain (or just take an elevator to the top of a tall building), you can feel your ears popping as you go up. That's because you need to have equal pressure inside your head (which has the old air from ground level in it) and outside your head (at the top of the mountain or building). The same thing happens when you go up in an airplane.
Bibliography and further reading about the atmosphere: