The most common causes are (in no particular order) infections, interstitial lung disease, and pulmonary oedema. Diagnosis
Type 1
Type 1 respiratory failure is defined as a low level of oxygen in the blood (hypoxemia) with either a standard (normocapnia) or low (hypocapnia) level of carbon dioxide (PaCO2) but not an increased level (hypercapnia). It is typically caused by a ventilation/perfusion (V/Q) mismatch; the volume of air flowing in and out of the lungs is not matched with the flow of blood to the lungs. The fundamental defect in type 1 respiratory failure is a failure of oxygenation characterized by:

This type of respiratory failure is caused by conditions that affect oxygenation, such as:

Low ambient oxygen (e.g. at high altitude)
Ventilation-perfusion mismatch (parts of the lung receive oxygen but not enough blood to absorb it, e.g. pulmonary embolism)
Alveolar hypoventilation (decreased minute volume due to reduced respiratory muscle activity, e.g. in acute neuromuscular disease); this form can also cause type 2 respiratory failure if severe. Diffusion problem (oxygen cannot enter the capillaries due to parenchymal disease, e.g. in pneumonia or ARDS)
Shunt (oxygenated blood mixes with non-oxygenated blood from the venous system, e.g. right to left shunt)

Type 2
Hypoxemia (PaO2 <8kPa or normal) with hypercapnia (PaCO2 >6.0kPa). The basic defect in type 2 respiratory failure is characterized by:

Type 2 respiratory failure is caused by inadequate alveolar ventilation; both oxygen and carbon dioxide are affected. Defined as the buildup of carbon dioxide levels (PaCO2) that has been generated by the body but cannot be eliminated.
Lack of oxygen response may indicate other modalities such as heated humidified high-flow therapy, continuous positive airway pressure or (if severe) endotracheal intubation and mechanical ventilation. .Type 2 respiratory failure often requires non-invasive ventilation (NIV) unless medical therapy can improve the situation. Mechanical ventilation is sometimes indicated immediately or otherwise if NIV fails. Respiratory stimulants such as doxapram are now rarely used.There is tentative evidence that in those with respiratory failure identified before arrival in hospital, continuous positive airway pressure can be helpful when started before conveying to hospital. See also
Ventilation/perfusion ratio
Pulmonary shunt

References
External links
MedlinePlus: Respiratory Failure