Type 1 respiratory failure occurs when the respiratory system cannot adequately provide oxygen to the body, leading to hypoxemia. Type 2 respiratory failure occurs when the respiratory system cannot sufficiently remove carbon dioxide from the body, leading to hypercapnia.