During inspiration, the intercostal muscles contract, moving the sternum up and out. This increases the thoracic volume, hence decreasing the pressure. The pressure gradient set up causes air inflow from outside. The diaphragm also flattens to increase the thoracic volume further.