The exchange occurs in the lungs thanks to the hemoglobin. I a nutshell, when exposed to fresh, oxygen-rich air, the hemoglobin picks up the oxygen and releases the CO2, by undergoing a change in its shape. The affinity for the oxygen is because of the iron atom in the center of the hemoglobin. The process involves substances such as 2,3 diphosphoglycerol, change in pH and temperature. These factos affect the affinity that the hemoglobin has for oxygen.