During inhalation, the diaphragm contracts, thus enlarging the thoracic cavity (the external intercostal muscles also participate in this enlargement). This reduces intra-thoracic pressure: in other words, enlarging the cavity creates suction that draws air into the lungs. When the diaphragm relaxes, air is exhaled by elastic recoil of the lung and the tissues lining the thoracic cavity in conjunction with the abdominal muscles which act as an antagonist paired with the diaphragm's contraction. 
Diaphragm is a flat muscle that separates the abdominal cavity and thoracic cavity. one of its important function is to help in the movement of air in and out of the lungs