In the respiratory system of humans, alveoli in the lungs are the site of gaseous exchange.
It is a thin-walled, sac-like structure lined by a single layer of flattened squamous epithelial cells.
Oxygen-rich air enters the lungs and reaches the alveoli.
The layers of cells lining the alveoli and the surrounding capillaries are each only one cell thick and are in close contact with each other.
Oxygen diffuses through the cells to the pulmonary capillaries due to the difference in the concentration gradient of oxygen molecules in the blood capillaries and the alveoli which are carried to different cells of the body.
Similarly, the pulmonary capillaries contain carbon-dioxide-rich air brought from different parts of the body as an end product of respiration.
This carbon-dioxide in the pulmonary capillaries diffuse into the alveoli due to the difference in the concentration gradient and are later exhaled out.