Air Pressure & altitude

We all live underneath a huge ocean of air that is several miles deep. The pressure on our bodies is about the same as ten meters of sea water pressing down on us all the time. As you go up a mountain, the air becomes less compressed and is therefore thinner.

Air pressure & altitude 2
pressure changes at altitude

Boyle’s law: the pressure of a given gas is inversely proportional to its volume at a constant temperature. This relationship between pressure and volume means doubling the volume of a given mass of gas decreases its pressure by half.
The percentage of oxygen molecules is exactly the same, 21%, at any given altitude, The problem is that the concentration of all the molecules decrease since the volume increased, including the Oxygen.
So although the percentage of oxygen in the atmosphere is the same, the thinner air means there is less oxygen to breathe.