The external partial pressure of oxygen decreases with altitude, for example in areas of high altitude or when flying. This decrease results in decreased carriage of oxygen by hemoglobin. This is particularly seen as a cause of cerebral hypoxia and mountain sickness in climbers of Mount Everest and other peaks of extreme altitude. For example, at the peak of Mount Everest, the partial pressure of oxygen is just 43 mmHg, whereas at sea level the partial pressure is 150 mmHg. For this reason, cabin pressure in aircraft is maintained at 5,000 to 6,000 feet (1500 to 1800 m). Diving. Hypoxia in diving can result from sudden surfacing. The partial pressures of gases increases when diving by one ATM every ten metres. This means that a partial pressure of oxygen sufficient to maintain good carriage by hemoglobin is possible at depth, even if it is insufficient at the surface. A diver that remains underwater will slowly consume their oxygen, and when surfacing, the partial pressure of oxygen may be insufficient (shallow water blackout). This may manifest at depth as deep water blackout. Suffocation. Decreased concentration of oxygen in inspired air caused by reduced replacement of oxygen in the breathing mix. Anaesthetics. Low partial pressure of oxygen in the lungs when switching from inhaled anesthesia to atmospheric air, due to the Fink effect, or diffusion hypoxia. Air depleted of oxygen has also proven fatal. In the past, anesthesia machines have malfunctioned, delivering low-oxygen gas mixtures to patients.
Thus any cause that influences the rate or volume of air entering the lungs (ventilation) or any cause that influences the transfer of air from the lungs to the blood may cause hypoxemia. As well as these respiratory causes, cardiovascular causes such as shunts may also result in hypoxemia. Hypoxemia is caused by five categories of etiologies: hypoventilation, ventilation/perfusion mismatch, right-to-left shunt, diffusion impairment, and low PO2. Low PO2 and hypoventilation are associated with a normal alveolar–arterial gradient (A-a gradient) whereas the other categories are associated with an increased A-a gradient. : 229

Ventilation
If the alveolar ventilation is low, there will not be enough oxygen delivered to the alveoli for the bodys use. This can cause hypoxemia even if the lungs are normal, as the cause is in the brainstems control of ventilation or in the bodys inability to breathe effectively. Respiratory drive
Respiration is controlled by centers in the medulla, which influence the rate of breathing and the depth of each breath. This is influenced by the blood level of carbon dioxide, as determined by central and peripheral chemoreceptors located in the central nervous system and carotid and aortic bodies, respectively. Hypoxia occurs when the breathing center doesnt function correctly or when the signal is not appropriate:

Strokes, epilepsy and cervical neck fractures can all damage the medullary respiratory centres that generates rhythmic impulses and transmit them along the phrenic nerve to the diaphragm, the muscle that is responsible for breathing.