During inhalation, the diaphragm contracts and increases the volume in the thoracic cavity which creates a low pressure region and provides more space to the lungs for expanding. The opposite of this happens during exhalation. The muscular nature of diaphragm allows it to contract and flatten.