Which BEST explains why the Earth has layers?

A.The Earth's layers formed because the heaviest materials (like iron and nickel) float on top of the lighter materials that make up the frost.
B.The Earth's layers formed because the heaviest materials (like iron and nickel) sink below the lighter materials that make up the crust.