Body plethysmography is a pulmonary function test that determines the amount of air in the lungs after taking a deep breath and exhaling fully. It works by detecting changes in box pressure and mouth pressure or airflow rate under defined breathing conditions to evaluate static lung volumes and airflow resistance.