Two Theories on How Earth Formed
Homogeneous Formation
The planet grows by accretion of planetesimals of similar composition.
Once the proto-planet is formed, heat from radioactive decay allows heavier
elements to sink to the core. This is called differentiation.
Earth's atmosphere is released from the heated rocks, via outgassing.
Inhomogeneous Formation
The Iron and nickel core of the planet condensed first from the Solar Nebula.
These materials solidify at higher temp. and would be the first solids to form.
Iron and magnesium silicates condensed next.
Aluminum and potassium silicates, water and gases condenses last,
finally giving the Earth an atmosphere.