Because the lungs are continuously pulling in air (as well as germs, particles and dirt), a system to protect the lungs in needed.
The mucus membranes that line the nose, mouth, throat and airways of the lungs are the first line of defense. The mucus traps dirt and foreign matter that we may breathe in. Tiny hairs (cilia) beat back and forth more than 1,000 times a minute in the airways to move the mucus and dirt up to where it can be coughed out of the body or swallowed.
Because of the requirements of gas exchange, alveoli are not protected by mucus and cilia. Mucus is too thick and would impair movement of oxygen and carbon dioxide.
Macrophages (special cells in the airways that consume toxins) are the next line of defense. Mobile cells on the alveolar surface (called phagocytes) seek out deposited particles, bind to them, ingest them, kill any that are living and digest them. Phagocytes in the lungs are called alveolar macrophages.
When the lung is exposed to serious threats, white blood cells in the circulation can help. For example, when the person inhales a great deal of dust or is fighting a respiratory infection, more macrophages are produced and white blood cells are recruited.