Dear student,
Residual volume keeps the lungs ventilated between consecutive breaths. Residual volume is the air that remains in the lungs even after maximum exhalation. The exchange of gases takes place during the time period between the end of expiration and beginning of next inspiration.
Regards.