Astrophysicists believe the Earth and the rest of the solar system is the result of the Big Bang and its explosions of massive stars. The Big Bang and the stellar explosions, called supernovas, blasted untold amounts of material into space. Eventually, the matter cooled down and began to clump together into a hot, spinning cloud that eventually became a solar nebula.
These events occurred not long after the Big Bang, about 13 billion years ago. About 4.5 to 5 billion years ago, scientists believe that the solar nebula began to spin and contract, most likely due to the influence of another nearby supernova. As it spun, the center of the solar nebula coalesced, ignited and became the sun. Rocky material in the solar nebula began to clump together in a process called runaway accretion. This process created the terrestrial planets that now orbit the sun. One of these planets was the Earth.
At first, the Earth was volcanic and so hot that metals began to melt and sink into what became its core. Layers of other materials surrounded the core and gave rise to the Earth's magnetic field. Eventually, the Earth began to cool, water and primitive life began to appear and oxygen entered the atmosphere.