This model most closely agrees with observations made of the solar system. The nebular model says that the sun and planets formed from a flattened cloud of interstellar material. Clouds of interstellar material have been observed throughout the universe. These clouds spin, causing them to flatten along their rotational axis. This accounts for the planets forming in the same plane.
Gravity also causes the cloud to collapse.
During this process, the center contracts into a ball of hot gas and dust. The next process is accretion, which results in planet formation. First, the gases outside of the sun condense into solid materials. These particles collide forming larger particles called planetesimals, which in turn collide and form protoplanets. These protoplanets then become planets.