The diaphragm contracts and moves down, the intercostal muscles contract, the ribs move up and out, the thoracic cavity gets bigger, air pressure inside the lungs decreases, air rushes in
The diaphragm relaxes and moves up, the intercostal muscles relax, the ribs move down and in, the thoracic cavity gets smaller, air pressure inside the lungs increases, air rushes out