The diaphragm flattens and the internal intercostal muscles relax whilst the external intercostal muscles contract during inspiration, creating a greater cavity volume and reduced pressure so air is drawn in.
In expiration, the diaphragm contracts, the external intercostal muscles relax and the internal intercostal muscles contract, creating a smaller volume in the cavity where air is forced out of the lungs.