Breathing is controlled by the autonomic nervous system (ANS), which is the automatic or unconscious part of the nervous system. The interesting thing about breathing is that you can also voluntarily influence it by consciously taking deep breaths, coughing, and holding your breath. Most of the body systems controlled by the ANS do not allow conscious "override" of functions. Along with automatic control, having some conscious influence on breathing shows the importance of maintaining this system.
Air is drawn into the lungs in order to extract oxygen from the air. Oxygen travels through tiny blood vessels in the lungs called alveoli. The alveoli allow oxygen molecules to enter the blood. The oxygen molecules are then distributed to all the cells in the body. When oxygen is metabolized by the body, carbon dioxide is released into the blood. Carbon dioxide waste is carried back to the lungs, where it is exhaled back into the air.
Breathing is controlled by many factors. The primary central nervous system (CNS) control of breathing is in the brainstem. A spinal cord injury or brainstem stroke can affect breathing. The main nerves involved in respiration include the phrenic, vagus, and posterior thoracic nerves.
The diaphragm is responsible for pulling the lungs in the body to draw in air. The diaphragm is controlled by the phrenic nerves that leave the spinal cord at layers C3, C4, and C5. An injury at this level affects the diaphragmatic control of breathing. A second set of muscles, the intercostal muscles, help air get into the lungs. The intercostal muscles lie between each rib. These muscles pull the lungs outward around the lungs. They help bring air into the lungs by lifting the ribs up and out. The intercostal muscles are controlled by the spinal nerves T1 to T11. Spinal cord injuries including these levels can affect the functional ability of the intercostal muscles. A third set of muscles also help draw air into the lungs by creating negative pressure in the lungs, the abdominal muscles. These muscles are controlled by spinal nerves T7 to L1. Spinal cord injuries including these levels can affect the intercostal and abdominal muscles. Other muscles, including the neck muscles, also help with breathing.
To exhale the air, the muscles that bring the air in the body relax. This relaxation of the muscle groups returns the lungs to their resting state, pushing air out of the body. Deoxygenated air and carbon dioxide exit the body. Inhalation can only be done by activating the muscles, but releasing air from the lungs doesn't require the muscles to work, they just relax and then expel the air. Muscles do not automatically push air out. You can consciously activate your muscles to force air out of your body, but the air comes out automatically during natural breathing.