Respiratory failure occurs when the respiratory system fails to maintain adequate gas exchange, leading to a decrease in oxygen levels (hypoxemia) and/or an increase in carbon dioxide levels (hypercapnia) in the blood. It is a severe condition that can result from various underlying causes, including toxic exposure.