When the intercostal muscles contract, the rib cage moves depending on which set of intercostal muscles is contracting. The external intercostal muscles contract to pull the ribs upward and outward, causing the rib cage to expand. This expansion increases the size of the chest cavity, which reduces the pressure inside and allows air to flow into the lungs during inhalation. Conversely, the internal intercostal muscles contract to pull the ribs downward and inward, leading to a reduction in the size of the chest cavity, which helps push air out during forced exhalation. In summary, contraction of the external intercostal muscles raises and expands the rib cage, while contraction of the internal intercostal muscles lowers and contracts the rib cage.