Nebular Theory explains how the solar system was formed.
The Nebular Theory says a nebula is a cloud of gas or ionized gas, formed with cosmic dust.
As a nebula contracts under the force of gravity it collapses and it will make the particles agglutinate in the centre of the nebula given rise for the formation of stars.