The main muscle of inhalation is the diaphragm. It is a very complex muscle. Most importantly for inhalation, it is attached to the bottom of the lungs.
When the diaphragm contracts it pulls down on the lungs increasing their volume. This creates a negative pressure in the lungs relative to outside pressure (law of equilibrium) and pulls in air from the outside to equalize the pressure. If the mouth is open, the air will rush in. A desire to breath basically activates the diaphragm to contract and expand the lung space. In exhalation the diaphragm relaxes to reduce the lung space as air escapes.
In exhalations, this action is countered by the internal intercostals which run opposite, from the spine up to the bottom front of the ribs. Upon contraction, they pull the ribs down and in, reducing space.
Unfortunately the diagram that correspond to the internal intercostals (from the website that contained the previous diagram) was incorrect. It simulated the action of the externals. The theory in pan-costal breathing is that during singing, the external intercostals remain active. Their antagonistic function to the internals (which should dominate in exhalation and singing) helps to keep the ribcage stable such that the usage of air is more directly controlled by the rise of the diaphragm and remaining muscles of exhalation namely the rectus abdominus, transverse abdominus and the obliques.