When you breathe in, your diaphragm contracts (tightens) and moves downward. This increases the space in your chest cavity, allowing your lungs to expand. The intercostal muscles between your ribs also help enlarge the chest cavity. They contract to pull your rib cage both upward and outward when you inhale.
As your lungs expand, air is sucked in through your nose or mouth. The air travels down your windpipe and into your lungs. After passing through your bronchial tubes, the air finally reaches and enters the alveoli (air sacs).
Through very thin walls of the alveoli, oxygen from the air passes to the surrounding capillaries (blood vessels). A red blood cell protein called hemoglobin helps move oxygen from the air sacs to the blood. (Oxygen is especially drawn to hemoglobin.)
At the same time, carbon dioxide moves from the capillaries into the air sacs. This gas has traveled in the bloodstream from the right side of the heart through the pulmonary artery.
Oxygen-rich blood from the lungs is carried through a network of capillaries, which lead to the pulmonary vein. This vein delivers the oxygen-rich blood to the left side of the heart. The left side of the heart then pumps the blood to the rest of the body. There, the oxygen in the blood moves from blood vessels into surrounding tissues.
Breathing Out (Exhalation)
When you breathe out, your diaphragm relaxes and moves upward into the chest cavity. The intercostal muscles between the ribs also relax to make the chest cavity smaller.
As the chest cavity shrinks, air rich in carbon dioxide is forced out of your lungs and windpipe, and then out of your nose or mouth.
Breathing out requires no effort from your body unless you have a lung disease or are doing physical activity. When you're physically active, your abdominal muscles contract and push your diaphragm harder against your lungs. This pushes the air in your lungs out rapidly.
What Controls the Ability to Breathe?
A respiratory control center at the base of your brain called the medulla oblongata controls your breathing. This center sends ongoing signals down your spine and to the nerves of the muscles involved in breathing.
These signals ensure your breathing muscles contract and relax regularly. This allows breathing to happen automatically, without you being aware of it.
To a limited degree, you can change your breathing rate, such as by breathing faster or holding your breath. Your emotions also can change your breathing. For example, being scared, angry or anxious can affect your breathing pattern.
Your breathing will change depending on how active you are and the condition of the air around you. For example, you need to breathe more often when you do physical activity. To adjust your breathing to changing needs, your body has a number of sensors in your brain, blood vessels, muscles and lungs.
Sensors in the brain and in two major blood vessels (the carotid artery and the aorta) detect carbon dioxide or oxygen levels in your blood and change your breathing rate as needed.
Sensors in the airways also detect lung irritants. These sensors can trigger sneezing or coughing. In people who have asthma, the sensors may cause the muscles around the airways in the lungs to contract. This makes the airways smaller.
Sensors in the alveoli (air sacs) can detect a buildup of fluid in the lung tissues. These sensors are thought to trigger rapid, shallow breathing.
Sensors in your joints and muscles detect movement of your arms or legs. These sensors may play a role in increasing your breathing rate when you're physically active.
Source: The National Heart, Lung, and Blood Institute; https://www.nhlbi.nih.gov/health-topics/how-lungs-work