This is because the air is no longer so dense at the height. So the density of the atmosphere gradually changes, and it goes into the cosmic vacuum.