The nebular hypothesis is the most widely accepted model in the field of cosmogony to explain the formation and evolution of the Solar System. It suggests that the Solar System is formed from the nebulous material.
Nebular Hypothesis:
According to this theory, the Sun and all the planets of our Solar System began as a giant cloud of molecular gas and dust. Then, about 4.57 billion years ago, something happened that caused the cloud to collapse. This could have been the result of a passing star, or shock waves from a supernova, but the end result was a gravitational collapse at the center of the cloud rom this collapse, pockets of dust and gas began to collect into denser regions. As the denser regions pulled in more and more matter, conservation of momentum caused it to begin rotating, while increasing pressure caused it to heat up. Most of the material ended up in a ball at the center while the rest of the matter flattened out into disk that circled around it. While the ball at the center formed the Sun, the rest of the material would form into the protoplanetary disc.
The planets formed by accretion from this disc, in which dust and gas gravitated together and coalesced to form ever larger bodies. Due to their higher boiling points, only metals and silicates could exist in solid form closer to the Sun, and these would eventually form the terrestrial planets of Mercury, Venus, Earth, and Mars. Because metallic elements only comprised a very small fraction of the solar nebula, the terrestrial planets could not grow very large.
In contrast, the giant planets (Jupiter, Saturn, Uranus, and Neptune) formed beyond the point between the orbits of Mars and Jupiter where material is cool enough for volatile icy compounds to remain solid (i.e. the Frost Line). The ices that formed these planets were more plentiful than the metals and silicates that formed the terrestrial inner planets, allowing them to grow massive enough to capture large atmospheres of hydrogen and helium. Leftover debris that never became planets congregated in regions such as the Asteroid Belt, Kuiper Belt, and Oort Cloud.