The job of the lungs is to transfer oxygen to the blood and to remove waste carbon dioxide from it. To do this the lungs contain millions of little air sacs called alveoli where the gases exchange happens.
The alveoli are specialised to maximise the diffusion of oxygen and carbon dioxide. They have: a large surface area, a moist lining for dissolving gases, very thin walls, a good blood supply.