The primary function of the lung is the exchange of gases between the body and the environment. The lungs contain a series of narrowing passageways that terminate into tiny sacs called alveoli. During respiration, oxygen enters the lungs by diffusion through the capillaries surrounding each alveolar sac. Similarly, when carbon dioxide diffuses out of the blood into the alveolar sacs, contraction of the chest muscles and diaphragm constrict the alveoli, forcing about 0.5 liters of air out of the lungs.
The average adult has millions of alveoli inside each lung. These small alveoli are present in large numbers to increase the surface area available for gas exchange between the lung and the environment.