Anatomy/Respiratory System

Mechanics
The Respiratory system is controlled in mammals by the diaphragm muscle. When the diaphragm is relaxed, the thoracic cavity is decreased in size. However, when the muscle is contracted, it pulls downward, adding size to the thoracic cavity. While this happens, the intercostal muscles pull upwards on the ribcage, adding more space to the thoracic cavity. When the diaphragm relaxes, it pushes upward on the lungs, along with the intercostal muscles pushing downward on the ribcage. These muscles decrease the volume while increasing their internal pressure. When the diaphragm relaxes, the lungs gain volume and lose pressure, causing a partial vacuum. Having no choice at this point but to follow the laws of nature, air follows the pressure gradient and rushes into the lungs.

Control of Breathing
Unlike digestion, pupil contraction, and the beating of your heart, breathing is controlled both unconsciously and consciously. Few other actions are like this, blinking being another example. When you are not thinking about your breathing, such as when you are at rest, you will unconsciously regulate your air intake. But when performing activities such as exercise, talking, or swimming, you are consciously deciding when to breath. When not being actively controlled, breathing is controlled by the brainstem. The brainstem will automatically regulate breathing as needed by the body. For instance, when you exercise, you need ATP for muscle contraction to occur. When you strength train, you enter the zone called anaerobic exercise. This triggers anaerobic metabolism, which causes a buildup of lactic acid in the body. This lowers blood pH, which can be fatal. The brainstem then increases the rate of breathing.