During inspiration, the diaphragm and external intercostal muscles contract, increasing the volume of the thoracic cavity. This causes the intrapleural pressure to become more negative, which increases the transpulmonary pressure, causing the lungs to expand.