Aspiration pneumonitis occurs when foreign materials, typically food, liquid, or vomit, are inhaled into the lungs. This can happen in individuals who have difficulty swallowing, are unconscious, or have a weakened gag reflex. The aspiration causes an inflammatory response in the lung tissue, leading to symptoms like cough, fever, and difficulty breathing.