As the protoplanets grew to become planets, parts of them melted due to radioactivity, gravitational influences, and collisions. Where the objects had melted, the composition of the planets changed. Heavier elements sank, forming the cores of the planets, and lighter objects rose to the surface.