The planet's first atmosphere, known as a proto-atmosphere, was formed from gases present in the solar system. It was primarily composed of hydrogen and helium, and to a much lesser extent, neon. These three gases are among the lightest elements so the atmosphere created by them was thin and weak. The combination of Earth's relatively low gravity and the heat of the Sun meant that the gases were heated to a point where they broke free and disappeared into open space.
A process known as outgassing helped form the secondary atmosphere. The gases for this atmosphere were initially trapped in the rocks and crust of the planet as ice. Because of Earth's size, there was a great deal of tectonic movement caused by its super-heated molten core. This created volcanoes which melted the ice trapped in the crust when they erupted, and which also ejected the gases created into the air. This process formed the basis of the secondary atmosphere and was added to by impacts from icy comets.
In its original form, the secondary atmosphere was composed of 58 percent water (H2O_. The second most common gas, at 23 percent, was carbon dioxide (CO2), followed by sulfur dioxide (SO2), at 13 percent. Nitrogen was the other main component of the atmosphere at just 5 percent with traces of neon, argon and krypton making up the rest.
As the atmosphere thickened, the composition began to change. The thicker atmosphere blocked some of the Sun's heat radiation and the planet cooled down. As it cooled, the H2O in the atmosphere began to condense and fall as rain, ultimately creating the oceans. Certain amounts of CO2 and SO2 made their way back into the rocks. The evolution of plant life introduced oxygen to the atmosphere. Biological and chemical processes through billions of years have made today's atmosphere very different. It is composed of 78 percent nitrogen, 20 percent oxygen, 4 percent water with traces of argon, carbon dioxide, neon, helium, methane, hydrogen, nitrous oxide and ozone.