It is left to your breathing muscles to actually move air into and out of the body. Muscles and lung tissue of course take orders from the brain where a second-by-second record is kept on exactly how much oxygen is needed by each muscle and body process at any given moment. A pretty fancy dance when you think about it. The brain sends orders for faster or slower breathing down to the respiration department.
A double layer of intercostals muscles is sandwiched between each pair of ribs and the big elastic diaphragm stretches across the bottom rim of your ribcage. To draw a breath in, the intercostals lift and swing your ribs gently out and up while the diaphragm flattens down. This effort creates a slightly enlarged ribcage. Fresh oxygen-rich air rushes in from outside the body to fill this new vacuum (similar to the action of a syringe or a bellows).
To exhale, the intercostals and the diaphragm simply relax and collapse. The ribs drop down out of the upward flare while the diaphragm rises to its domed-up resting position. This overall relaxation results in a slightly smaller ribcage with smaller capacity. There is no place for the contained air to go but out. Exhalation is simply a letting go of the breathing muscles without slumping the spine. Inhalation is active. Exhalation is letting go of that action.
Be well. Breathe beautifully.
