Firstly, the intercostal muscles contract. This causes the ribcage to move upwards and outwards. The diaphragm also contracts. This all has the combined effect of increasing the volume of the lungs. As a result, the pressure inside the lungs decreases, and eventual becomes lower than atmospheric pressure. This causes air to be drawn into the lungs.