Oxygen mask to patients
Oxygen masks can provide up to near 100% oxygen, whereas the atmosphere contains only ~20%. Typically, oxygen is provided in cases where patients' blood oxygen saturation is low or is likely to be low.

Giving a patient supplemental oxygen helps them to achieve oxygen saturation even if their breathing or circulation is impaired, and allows slightly more oxygen to be dissolved in the blood, which can be helpful in cases of blood loss or other traumatic insults.

I'm not sure of any cases where patients simply die immediately if their oxygen mask fails, outside of movies/TV; it's more of an issue of trying to provide the best outcome possible in a difficult situation.

There are also some negative side effects of oxygen supplementation. Overall, Wikipedia has a reasonable overview of these, as well as the indications for oxygen supplementation.