How You Breathe
Your lungs are located within your chest cavity inside the rib cage (see illustration below). They are made of spongy, elastic tissue that stretches and constricts as you breathe. The airways that bring air into the lungs (the trachea and bronchi) are made of smooth muscle and cartilage, allowing the airways to constrict and expand. The lungs and airways bring in fresh, oxygen-enriched air and get rid of waste carbon dioxide made by your cells. They also help in regulating the concentration of hydrogen ion (pH) in your blood.
When you inhale, the diaphragm and intercostal muscles (those are the muscles between your ribs) contract and expand the chest cavity. This expansion lowers the pressure in the chest cavity below the outside air pressure. Air then flows in through the airways (from high pressure to low pressure) and inflates the lungs. When you exhale, the diaphragm and intercostal muscles relax and the chest cavity gets smaller. The decrease in volume of the cavity increases the pressure in the chest cavity above the outside air pressure. Air from the lungs (high pressure) then flows out of the airways to the outside air (low pressure). The cycle then repeats with each breath.