Once the oxygen in the blood has been used by the tissues, oxygen deplete blood is carried to the lungs. This comes into close contact with the oxygen rich environment of the alveoli, and diffusion occurs between the area of low oxygen concentration and the area of high oxygen concentration and oxygen subsequently moves from the alveoli into the lungs.
The carbon dioxide present in the blood also travels from an area of low concentration to an area of high concentration. In contrast, the carbon dioxide subsequently moves from the blood into the alveoli. This carbon dioxide is subsequently expired, and more oxygen rich air is inspired to restart the process as more oxygen deplete blood is carried to the lungs.