Alveolar sacs contain tiny pouches called alveoli, whose primary function is gas diffusion. These clusters of alveoli have thin walls that allow oxygen to pass easily from the lungs into the bloodstream and carbon dioxide to flow from the blood to the lungs so it can exit the body.