How is CO2 and O2 separated in our body during breathing?
It all comes down to concentration gradients. In deoxygenated blood, which is what enters the lungs, the O2 concentration is relatively low and the CO2 concentration is higher than that of ambient air. On the flip side, the air that we breathe in has a higher concentration of O2 than deoxygenated blood. The alveolar membrane is thin enough that the gases can diffuse across this gradient almost instantly. And just like that, you have oxygenation of blood, and removal of CO2.