Origin of the Earth - The Solar Nebula Hypothesis
About 4.6 billion years ago our solar system formed from a cloud of gas and dust which slowly contracted under the mutual gravity of all of its particles. The cloud was made largely of hydrogen (H) with some helium (He) and small amounts of the remaining naturally occurring chemical elements. The elements larger than He had to have been produced in a supernova.
The initial rotation or tumbling motion was accelerated as the nebula contracted, like a spinning skater who pulls in his arms to spin faster. The contracting, rotating cloud flattened into a disc. Within the disc, the largest concentration of matter was in the center. This became the sun. Matter collected in smaller clumps out in the disc. These became the planets. The proto-sun and proto-planets grew by accretion of the matter that was falling in toward the center of mass. The solar nebula warmed as the contraction increased the pressure. As the proto-sun grew and the pressures increased, it got hot from gravitational compression. It started to glow red. The heat from the proto-sun heated the solar nebula, especially the inner nebula. Eventually the pressures and temperatures in the core of the proto-sun became great enough that hydrogen nuclei fused together to form helium. This nuclear reaction released huge amounts of energy, as it continues to do today. The sun was born. During the T-Tauri phase, the very strong solar wind swept most of the remaining gas and particles smaller than about 10 m from the inner solar system leaving only the planets and asteroids. The planets had attained almost all of their mass by this time but heavy meteor bombardment continued for another half-billion years or so.
At the high temperatures of the inner solar nebula the small proto-planets (Mercury, Venus, Earth, Mars) were too hot to hold the volatile gases that dominated the solar nebula. Only refractory (high melting point) materials like iron and rocky silicates were stable. Consequently, the terrestrial planets are made primarily of metallic cores and silicate mantles with atmospheres thin or absent. In the outer solar nebula temperatures were cool enough for the abundant gases to accumulate and be held by proto-planets. As a result the Jovian planets (Jupiter, Saturn, Uranus, and Neptune) are gas giants, made mostly from hydrogen, helium, and hydrogen compounds like methane (CH4) and ammonia (NH3).
Segregation of the Earth's Layers and Atmosphere
The materials that accreted into the early Earth were probably added piecemeal, without any particular order (though some models call on sequential accretion of metallic and then silicate materials). The early Earth was very hot from 1) gravitational compression, 2) impacts, and 3) radioactive decay (much more than today). The early Earth was probably partially or largely molten. The denser metallic liquids sank to the center of the Earth and less dense silicate liquids rose to the top, like oil rises to the surface of water. In this way the Earth very quickly differentiated into a metallic, mostly iron core and a rocky silicate mantle.
Through igneous (volcanic and intrusive) activity the crust of the Earth eventually formed. The composition of the mantle is silicate, rich in iron and magnesium, similar to the compositions of stony meteorites and moon rocks. The crust, on the other hand, is more enriched in silica with lesser amounts of iron and magnesium. The high silica rocks of the crust (or rather the assemblage of minerals in crustal rocks) generally have lower density and lower melting temperatures than mantle rocks (minerals). Crustal rocks formed by partial melting of mantle rocks (melting of the lowest melting temperature, highest silica, minerals in the mantle rocks. This yields a more silica-rich magma (molten rock) than the mantle rocks. The magma, being less dense than the rock from which it formed, can rise to the surface, cool, and crystallize. This general process occurred slowly over time after the Earth cooled enough that mantle rocks could not melt completely. Much continental crust, the most silica rich and least dense kind, had been produced by 2.5 billion years ago.
Formation and Evolution of the Atmosphere
Volatile materials, carried by certain types of meteors and by comets, were added to the Earth by impacts, some of which penetrated the interior. Gases in the mantle prefer to go into any melt that forms and happily escape into the atmosphere if the melt reaches the surface. Volcanic activity, especially at the midocean ridges, volcanic arcs, and hotspots, releases large amounts of water vapor, carbon dioxide, and other gases into the atmosphere.
Earth's atmosphere today is 78% nitrogen (N2), 21% oxygen (O2). This is very different from the atmospheres of the Earth's companion terrestrial planets Venus and Mars, whose atmospheres are dominated by carbon dioxide (CO2), but with no free oxygen. Even more different are the atmospheres of the Jovian planets composed of H, He, and H compounds CH4 and NH3. Water vapor (H2O), CO2 and N2, along with other gases, are released to the surface by volcanic activity on Earth today, and presumably also in the early days of Earth. These gases resemble the atmospheres of the other terrestrial planets. So if the Earth's atmosphere was originally dominated by these gases, how did it change to the point where N2 and O2 are dominant and CO2 is minor? And what about all of the H2O?
Once life evolved, by 3.5 b.y. ago photosynthesis started to store energy in the chemical bonds of simple carbohydrate (CH2O). Photosynthesis takes CO2 out of the atmosphere and replaces it with O2.
CO2 + H2O (plus sunlight) --> CH2O + O2
The energy stored via photosynthesis is used by organisms (including photosynthetic ones) by respiration, which takes O2from the air, combines it with carbohydrates (and other organic matter), and releases the CO2 back into the atmosphere.
CH2O + O2 --> (energy for cellular processes) CO2 + H2O
But photosynthesis and respiration aren't balanced. Part of the organic matter that is produced is washed into soils and down rivers and deposited in sedimentary strata where it is stored.
Over geologic time, most of the CO2 has been removed from the atmosphere and stored in sedimentary rocks, O2 has been added, and N2 has continued to accumulate from outgassing. Of course most of the released water vapor condensed to form the oceans.
Fossil fuels are the remains of the organic matter stored in sedimentary rocks. Burning of fossil fuels returns CO2 that has been locked away for millions to hundreds of millions of years back to the atmosphere, and altering the present balance of the atmosphere and Earth's climate (because CO2 is a greenhouse gas).