In complex animals, where the cells of internal organs are distant from the external environment, respiratory systems facilitate the passage of gases to and from internal tissues. In such systems, when there is a difference in pressure of a particular gas on opposite sides of a membrane, the gas diffuses from the side of greater pressure to the side of lesser pressure, and each gas is transported independently of other gases. For example, in tissues where carbon dioxide concentration is high and oxygen concentration is low as a result of active metabolism, oxygen diffuses into the tissue and carbon dioxide diffuses out.
In lower animals, gas diffusion takes place through a moist surface membrane, as in flatworms; through the thin body wall, as in earthworms; through air ducts, or tracheae, as in insects; or through specialized tracheal gills, as in aquatic insect larvae. In the gills of fish the blood vessels are exposed directly to the external (aquatic) environment. Oxygen–carbon dioxide exchange occurs between the surrounding water and the blood within the vessels; the blood carries gases to and from tissues.
In other vertebrates, including humans, gas exchange takes place in the lungs. Breathing is the mechanical procedure in which air reaches the lungs. During inhalation muscular action lowers the diaphragm and raises the ribs; atmospheric pressure forces air into the enlarged chest cavity. In exhalation the muscles relax and the air is expelled. This combined rhythmic action takes place about 12–16 times per minute when the body is at rest. The rate of breathing is controlled mainly by a respiratory center in the brain stem that responds to changes in the level of hydrogen ion and carbon dioxide in the blood, as well as to other factors such as stress, temperature changes, and motor activities. Some residual air always remains in the lungs, but with each breath an additional quantity of fresh air, called tidal air, is inhaled. Artificial respiration is used for respiratory failure.
In higher vertebrates, oxygen-poor, carbon dioxide–rich blood from the right side of the heart is pumped into the lungs and flows through the net of capillaries surrounding the alveoli, the cup-shaped air sacs of the lungs; oxygen diffuses across the capillary membranes into the blood, and carbon dioxide diffuses in the opposite direction. The oxygen combines with the protein hemoglobin in red blood cells as the blood returns to the left side of the heart, is pumped throughout the body, and is released into tissue cells (see circulatory system). Carbon dioxide passes in the opposite direction, from the cells of the tissues to the red blood cells. In the blood, carbon dioxide exists in three forms: as bicarbonate ion, in which form it serves as a buffer, keeping blood acidity fairly constant; combined with hemoglobin; and as the dissolved free gas. Of these, only free carbon dioxide gas is available for diffusion from the blood into the lungs.