The Earth is divided into layers by density. As the Earth solidified during the formation of the solar system elements with higher density were drawn.