Movement of gas in and out of the lungs, especially the elimination of carbon dioxide. Adequate oxygen saturation does not guarantee adequate ventilation.