Scientists studying the origin of life are interested in the composition of Earth's early atmosphere, because its chemistry might have played an important role in the development of life. Unfortunately, figuring out which gases were present isn't an easy task. Scientists have to make inferences, study Earth's geological features and decide what these clues can tell them about the our planet's early atmosphere.
Like the other planets of the inner solar system, Earth formed through a process of accretion -- collision of rocks and dust particles, which gradually formed a larger and larger object. These impacts generated a lot of heat, so early Earth would have been a hot and desolate place. Water vapor is thought to have formed a steam atmosphere, and incoming iron-rich rocks colliding with Earth would have reacted with some of this water to give rise to hydrogen gas.
Loss of Hydrogen
Although Earth's first atmosphere contained hydrogen, water vapor and helium, it changed quickly. Hydrogen and helium are very light gases, so light that Earth's gravity is too weak to hold them. Most of the hydrogen and helium of the early atmosphere escaped into space. As Earth gradually cooled, the water vapor condensed, and rain fell.
As Earth lost its hydrogen and helium to space, gases escaping from volcanoes soon became a key source of Earth's atmosphere. Like volcanoes today, these eruptions probably emitted water, CO2, sulfur dioxide, carbon monoxide, chlorine, nitrogen, hydrogen, ammonia and methane. But, as Earth continued to cool, water vapor from this early atmosphere fell as rain and began to form the first oceans.
Faint Young Sun
Earth's first atmosphere was rich in greenhouse gases like CO2. This was important because the sun was fainter in its early history, and the amount of energy Earth received from the sun was less than what it is today. Without these greenhouse gases, the cooling Earth would soon have become too cold to support liquid water, a serious barrier to the formation of life as we know it. Early bacteria might have also produced significant amounts of methane, another potent greenhouse gas, which would have enhanced the greenhouse gas effect.