Our solar system is a pretty stable environment. The planets orbit the sun and have done so in the same manner for billions of years, and will continue to do so for billions more. However, there was a stage when this wasn’t true.
This beautiful image, taken by the Hubble telescope, shows the Pillars of Creation. Part of the Eagle Nebula, they are a region of space where stars are forming. If you look closely at the image, you’ll see tiny clumps and bumps. These will one day be stars and solar systems.
The process that drives this is a lengthy one, and it is driven by gravity. Once something happens to perturb the gas and dust within a nebula, molecular cloud or Bok globule, a centre of mass begins to form, and as this mass grows, the object’s gravity will attract more and more mass, and thus its gravity gets stronger, and so on and so forth, until other forces begin to come into play.
As the gas contracts, it heats up, and as more matter continues to gather around a central point, this heat rises. Eventually, the temperature reaches the stage where fusion ignites, and the outward force of this reaction counter-balances the gravity that is crushing everything inward. The star is born.
It’s actually all a lot more complicated than this, with the formation of a proto-star that doesn’t actually undergo the hydrogen to helium reaction until other things happen, but you get the idea.
The newly formed star will have been accompanied (in some cases) by a disc of material that would be undergoing localised collapses of its own. This ‘planetary disc’ is made up of gas and dust, which clumps together to form rocks. These rocks collide with each other and stick together, forming planets. When the sun switches on for the first time, its solar wind blows some of this material outward – gases may be captured by planets that will eventually become gas giants, whilst some of this material will form comets and asteroids, far from the star.
This process is quite violent, especially shortly after the sun has first ignited. Asteroids and proto-planets crash into each other frequently, and in our own solar system, the early earth would have been pummelled. In fact, it’s thought we owe the existence of the Moon to a massive impact between the earth and a Mars-sized planet.
Of course, eventually this all settles down. If it didn’t, we wouldn’t be here today.