It traps heat, shields the surface from harmful radiation, and provides chemicals needed for life, such as nitrogen and carbon dioxide.