Vigorous exercise increases respiration as the body uses more oxygen to deliver the energy needed for motion. Insects also need increased oxygen during vigorous activity such as flight. Many large flying insects have air sacs that can store air. The sac can be compressed and expanded to force air in and out of the tracheal system.
Lutz Wasserthal studied* the flow of air in the thorax of the hawkmoth, Manduca sexta during flight. He found that during the downstroke of the moth wing, the air sac in the thorax expands allow air to enter. More interesting, the spiracle (opening to the tracheal system) on the posterior thoracic segment is closed during the downstroke while the anterior thoracic spiracle is open. This makes the air flow from front to rear. The air sacs contract during the upstroke of the wing when the posterior spiracle is open. Air continues to move front to back and is forced out the posterior spiracle. Thus, the moth is pumping air in through the front of the thorax and out the back.
The flight muscles are pumping air through the respiratory system at the same time that they move the wings. The moth has greater air exchange during flight than when it is resting.
*Lutz Wasserthal. 2001. FLIGHT-MOTOR-DRIVEN RESPIRATORY AIR FLOW IN THE HAWKMOTH MANDUCA SEXTA. The Journal of Experimental Biology 204, 2209–2220.