OpenStax Anatomy and Physiology
There are three sets of muscles, called intercostal muscles, which span each of the intercostal spaces. The principal role of the intercostal muscles is to assist in breathing by changing the dimensions of the rib cage .
The 11 pairs of superficial external intercostal muscles aid in inspiration of air during breathing because when they contract, they raise the rib cage, which expands it. The 11 pairs of internal intercostal muscles, just under the externals, are used for expiration because they draw the ribs together to constrict the rib cage. The innermost intercostal muscles are the deepest, and they act as synergists for the action of the internal intercostals.
Betts, J. G., Young, K. A., Wise, J. A., Johnson, E., Poe, B., Kruse, D. H., … DeSaix, P. (n.d.). Anatomy and Physiology. Houston, Texas: OpenStax. Access for free at: https://openstax.org/details/books/anatomy-and-physiology