The inner lining of the respiratory system consists of mucous membranes and is protected by multiple immune defenses. The goblet cells within the respiratory epithelium secrete a layer of sticky mucus. The viscosity and acidity of this secretion inhibits microbial attachment to the underlying cells. In addition, the respiratory tract contains ciliated epithelial cells. The beating cilia dislodge and propel the mucus, and any trapped microbes, upward to the epiglottis, where they will be swallowed. Elimination of microbes in this manner is referred to as the mucociliary escalator effect and is an important mechanism that prevents inhaled microorganisms from migrating further into the lower respiratory tract.
The upper respiratory system is under constant surveillance by mucosa-associated lymphoid tissue (MALT), including the adenoids and tonsils. Other mucosal defenses include secreted antibodies (IgA), lysozyme, surfactant, and antimicrobial peptides called defensins. Meanwhile, the lower respiratory tract is protected by alveolar macrophages. These phagocytes efficiently kill any microbes that manage to evade the other defenses. The combined action of these factors renders the lower respiratory tract nearly devoid of colonized microbes.
Parker, N., Schneegurt, M., Thi Tu, A.-H., Forster, B. M., & Lister, P. (n.d.). Microbiology. Houston, Texas: OpenStax. Access for free at: https://openstax.org/details/books/microbiology