The level of oxygen present in mammalian blood - critical for survival - is controlled by a complex feedback system triggering more or less breathing, alterations in blood pressure etc.. It's dependent on 'sensors', one primary sensor is called the Carotid Body.
“Oxygen (O2) sensing by the carotid body and its chemosensory reflex is critical for homeostatic regulation of breathing and blood pressure.”
However, the molecular mechanisms for detecting variations in oxygen partial pressure have yet to be identified. There may be multiple mechanisms and could vary between species.
Further reading on O2 regulation: Oxygen sensors in context Biochimica et Biophysica Acta (BBA) - Bioenergetics Volume 1777, Issue 1, January 2008, Pages 1–14