From what i know which I'm not astrophysicist but i do know quite a bit. You are correct that the planets came from the sun but they are formed by nova's. When a nova happens it shoots heavier elements into space in a cloud of dust. The sun was once a solo Red Giant star Please Register or Log in to view the hidden image! and experienced a supernova which created a planetary nebula. The nebula then collected the particles of dust together by the force of gravity and formed planets at the center points of the nebula with the most mass. Earth's core is molten due to hydrostatic pressure, tidal forces exerted on the planet by its orbit about the Sun, radioactive elements, and an abundance of sulfur, which helps the iron in the core to remain in a molten state. I think you came to the conclusion that all the planets are remaining chunks of flaming sun? It's partially true on a simplistic level.