The nebular theory of solar system formation suggests that stars and their planets form out of cooling interstellar clouds of molecular hydrogen. As the cloud contracts, it forms a disc of dense material that forms the star. As it forms, the star throws off material that coalesces into planets.
While the nebular theory is not the only theory for the formation of stars and planets, there are several pieces of evidence that support it. The fact that the planets in the solar system orbit in the same direction suggests common origins, perhaps from the accretion disc of a young star. Also, the fact that the inner planets are rocky and the outer planets are gas giants matches the nebular theory, since denser materials would be found closer to the fledgling star while lighter frozen gases would exist on the periphery of the disc.
The nebular hypothesis also explains the presence of the asteroid belt between Mars and Jupiter. As Jupiter was just past the solar system's "frost line," it formed from a dense disc of frozen gas, creating a giant planet. Its intense gravity was enough to disrupt any planets forming nearby, tearing apart any planetesimals that formed between it and Mars and creating a relatively dense belt of asteroids between the orbits of the two planets.