Alveoli facilitate gas exchange through their unique structure. The thin walls and the close proximity of capillaries allow oxygen to diffuse from the alveoli into the blood and carbon dioxide to diffuse out of the blood into the alveoli. This process is driven by differences in partial pressures of the gases.