Blood flows into the lungs from around the body, it is carrying CO2 produced by respiration in the cells of the body CO2 passes from the blood into the avioli then breathed out of the body, O2 is breathed into the lungs it dissolves in the water lining, the alvioli from there it passes into the blood, blood carries O2 away from the lungs and every cell in the body.
The surface of alvioli is thin and moist it is like this is so that gases can pass through or be exchanged easily.
Alvioli are smaller than grains of salt there are about 300 million of these in our lungs, alviol have a very large surface area, plenty of room for gas exchange.
The surface of the alvioli are covered with capillaries, these are narrow blood vessels one cell thick, oxygen is passed from the alvioli into the blood stream which distributes it to the cell where it is used to unlock energy from the food, the blood carries carbon dioxide, a waste product from the oxygen filled food cells back to the capillaries, where it goes back through the walls of the avioli and is breathed out when you exhale as waste