The contraction and relaxation of the diaphragm and rib cage muscles ventilate the lungs. Contraction decreases pressure in the lungs and air flows in. Relaxation of the muscles forces air out of the lungs.