Everything on our map, from the Sun to the Oort cloud, came from a single cloud of cold gas and dust that drifted through the Milky Way 4.6 billion years ago. Here is the story in five steps.
1. Collapse
Something, perhaps the shock wave from a nearby supernova, nudged part of the cloud to collapse under its own gravity. As it shrank it spun faster, like a skater pulling in their arms, and flattened into a disc with a dense, hot core. That core became the Sun.
2. The frost line
Close to the young Sun the disc was hot, and only rock and metal could condense. Beyond about 3 AU, roughly where the asteroid belt is now, it was cold enough for water, ammonia and methane to freeze. This "frost line" is why the inner planets are small and rocky while the outer planets are giants: beyond the line there was far more solid material available.
3. From dust to planets
Dust grains stuck together into pebbles, pebbles into kilometre-sized planetesimals, and planetesimals collided and merged into protoplanets over a few million years. Jupiter grew fastest, reaching a core of ten Earth masses and then pulling in gas from the disc until it was 318 times Earth's mass. Saturn, Uranus and Neptune followed, though by the time the ice giants formed most of the gas had gone.
4. Migration and chaos
The giant planets did not stay put. Simulations suggest Jupiter moved inward and then back out, scattering material and starving Mars of building blocks, which may be why Mars is so small. Later, interactions between the giants flung icy debris across the Solar System, creating the Kuiper belt and Oort cloud and possibly triggering the Late Heavy Bombardment that scarred the Moon.
5. The Moon
Around 4.5 billion years ago a Mars-sized body struck the young Earth. The debris thrown into orbit coalesced into the Moon within a matter of years. That is why the Moon's rocks are so similar to Earth's mantle, and why it is so large relative to its planet.
What is left over
The asteroids, comets and Kuiper belt objects are the scraps that never became planets, largely unchanged since the beginning. That is why missions like Rosetta, OSIRIS-REx and New Horizons target them: they are samples of the original recipe.



