They are separate as you say.
The way I like to see it is that more muscles are "recruited" as more intense breathing is required.
When forced inhalation is required, other muscles such as the intercostals (rib elevation and expansion) work to increase thoracic volume.
Further, muscles of the neck can also become involved as needed to lift and open the chest.
It is noteworthy that the muscles have separate innervations - phrenic nerves to diaphragm and intercostal nerves to the intecostal muscles (cervical vs thoracic).