Air always moves from an area of higher pressure to an area of lower pressure, an example of this is when there is a puncture in a tyre. The air in the tyre is at higher pressure than normal and so when the tyre is punctured you hear the air moving out of the tyre, to where there is a lower pressure through the hissing sound it makes. When we breath the movement of air works in the same way. One way to decrease the air pressure in a space is to increase its volume, which is what happens when we breath in. This is also known as inspiration. The diaphragm - a flat sheet of muscle at the bottom of the lungs, contracts and moves downwards. The external intercostal muscles between the ribs contract, pulling the ribcage upwards and outwards. These changes increase the volume of the lungs, which leads to a decrease of air pressure in them. This causes air to move from higher pressure outside the body into the lungs which at are a lower pressure. Air continues to move into the lungs until the pressure in them equals the pressure outside the body, and inhalation stops when the pressure inside the lungs equals the pressure outside the lungs.
In exhalation, the opposite happens. The intercostal muscles relax, drawing the rib cage downwards and inwards, and the diaphragm relaxes, causing the lungs to decrease in length. This decreases the volume in the lungs, and increases the pressure. Air then moves from the lungs, which are at a high air pressure, to outside the body, which is at a lower pressure.