The law of diffusion states that gas will go from an area of high concentration to an area of low concentration.
Carbon dioxide diffuses from the blood into the alveoli and oxygen diffuses from the alveoli into the blood.