This is referred to as gas exchange. The alveolar-capillary CO2 and O2 gradient drive diffusion of gasses across the alveoli membrane. Oxygen in the alveoli diffuses into capillaries where its concentration is low while carbon dioxide from the capillaries diffuse into the alveoli where its concentration is low.