As the diaphragm contracts, the volume of the thoracic cavity increases and air is drawn into the lungs.