Both gills and lungs are efficient respiratory surfaces. Sea animals have gills that extend into the water, and land animals have lungs that are protected from drying by being located within the body cavity. There are four or so separate gill arches with filaments on them. Each filament has many lamellae on it, and these lamellae are small bars with a thin membrane on the outside and a set of capillaries inside. Lungs are blind sacs, unlike the open systems of fish gills.
Atmospheric air enters the airways and ends at the alveoli, with their capillaries in the walls.
This is where gas exchange occurs as the pulmonary artery brings low-O2 blood to the alveoli and O2 enters by diffusing across the alveolar wall. The lungs have a surface area for exchange of 80 square meters. After O2 enters the alveoli, it diffuses across the membrane to the capillary, raising the O2 content of capillary blood to about 100 mmHg. It then travels via the pulmonary vein to the heart, then to the systemic capillaries where the O2 is given up to the tissues. At the same time, CO2 is produced by the cells and added to the venous blood.