We need to get oxygen from the air into the blood, and we need to remove waste carbon dioxide from the blood into the air. Moving gases like this is called gas exchange.
The alveoli are adapted to make gas exchange in lungs happen easily and efficiently. Here are some features of the alveoli that allow this:
The gases move by diffusion from where they have a high concentration to where they have a low concentration:
Some water vapour is also lost from the surface of the alveoli into the lungs - we can see this condensing when we breathe out on cold days.