This kind of question is extremely common in A level biology, they want you to explain a system and apply your knowledge of biological principals to it.
To understand alveoli we need to understand the concept of diffusion across concentration gradients. Diffusion describes how a substance will move from an area of higher concentration to an area of lower cocentration, down its concentration gradient. In this case oxygen will move from the alveolar space into the blood stream and carbon dioxide back the other way, this is known as gas exchange.
You will have learnt that the speed of diffusion depends on a few key factors, so if you apply those here you'll be able to answer the question. Firstly, a smaller distance to travel increases the speed so the fact that the alveolar wall is only one cell thick allows for more efficient has exchange. Also the greater the concentration gradient the faster the exchange, which the alveoli provide by being elastic to increase the rate of ventilation. Finally, the greater the surface area for exchange, the more rapid the exchange. Alveoli are very small and we have a lot of them meaning increasing the surface area available and they also produce surfactant a special substance which keeps them open.