The respiratory system consists of the airways, lungs, and respiratory muscles that mediate air flow into and out of the body. Within the lungs, oxygen and carbon dioxide are passively exchanged between air and blood through diffusion. The system also helps maintain acid-base balance by efficiently removing carbon dioxide from the blood. Air flows through the upper respiratory tract into the lower respiratory tract and lungs where gas exchange occurs in the alveoli.