Within a few hundred million years, this soup of primordial nutrients would birth the Solar System. Of key importance for our nativity was a cosmic shockwave which rippled through our nebula (cloud of funky space dust). Most probably caused by the supernova of a dying star, the shockwave caused the nebula to coalesce and spin. As the nebula grew denser gravity started to have more of an effect, and the gravitational energy converted into heat; simultaneously, the nebulas radius shrank, causing its spin velocity to increase.
This process is known as the conservation of angular momentum with angular momentum dealing with the rate by which an object spins. To picture it imagine an Olympic figure skater spinning on the ice with their arms outstretched, the skater's angular momentum is greater the further their hands are from the centre of spin, which is their body. As they draw their arms in angular momentum decreases, it cannot be destroyed so is converted into the spin's velocity. The skater will speed up. This same process is applicable on a cosmic scale.
As the spin increases the cloud forms into a hot flat disk instead. Eventually, as the heat and pressure continue to build it becomes sufficient for nuclear fusion to take place with hydrogen forced together to form helium. This took place 4.6ish billion years ago for our sun and could be considered the solar system's birth. However, this early period would’ve been lonely for the sun’s only company was the disk of material spinning around her that would one day metamorphose into the planets.
The gases away from the core of the disk where the solar formation was taking place would’ve begun cooling and as such elements would begin to condense out of them based on their volatility (which describes how readily an element will condense or vaporise). More volatile elements would have condensed out last; the table below shows which elements would've condensed out first and at what temperature ( You can ignore the classifications along the x-axis at the top).
Once the gases begin to condense the material can start to accrete (come together) as shown above the refractory elements are the first to condense, and the oldest found thus far are 4568 million years old. Slowly over many millions of years, asteroids (space rocks) and planetesimals (large space rocks) will begin to form, with the larger object accretions taking place violently and culminating in the production of a terrestrial (composed of rock) planet. Analysis of these early rocks and solar system formation is possible by analysing meteorites that preserve those primordial properties. The most important types of meteorites are called Chondrites. They have been used to determine the primordial earth's bulk composition, which is too complex a subject to go into detail in this article. The oldest Chrondirtes are around 4563 million years old, and the Earth is around 4550 million years old. This highlights that accretionary processes did not take huge swathes of time geologically speaking, in only 18 million years our planet formed from nought but dust.
The oldest Lunar rocks on record are 4430 million years old and show that the Earth-moon system stabilised within 100 million years of meteorite formation. The moon was formed by the impact of a large Mars-sized planetesimal called Theia, as you can imagine, such an impact would have obliterated and liquidised the surface of our humble home. The detritus of the impact was left in orbit around Earth and would've created an accretionary disk akin to that seen around Saturn but far less stable. Accretionary processes would've taken place forming our moon, as such the Moon is geochemically similar in composition to Earth’s mantle as a result of this collision and amalgamation.
For gas giants such as Jupiter, there is more to formation than accretion. For example, Jupiter is absolutely massive and pushes the boundary of how big a planet can be before it starts to become a star. If you calculated the mass of every other planet combined and then doubled that value, it still would not be as massive as Jupiter. You could fit the Earth in Jupiter 1000 times before you'd fill it. It is a leviathan planet, so you can understand why the Romans named it after the king of the Gods.
One model suggests Jupiter began to form much as Earth did with the accretion of smaller objects. Once a planet becomes moon-sized, it can begin to form an atmosphere. When it reaches the Martian scale, it can form oceans; once a terrestrial planet gets massive enough, those Oceans will boil, and its atmosphere will grow exponentially, eventually synthesizing a gas giant.
In other solar systems observed in the galaxy, gas giants are often far closer to the host star, and larger terrestrial planets exist. One such model to explain why this is not the case is that Jupiter wandered the early solar system, its gravity sending a generation of planetesimals into sunny oblivion or the depths of interstellar space being dragged back to the outer solar system due to interaction with Saturn.
Many of the topics discussed in this article are theories, models and hypothesis with this being an ever-evolving field of scientific study. If you’d like to learn more about space, the most accessible and one of the most useful sources used for this article was “Wonders of the Solar System and the Universe” by Professor Brian Cox & Andrew Cohen.