Many ideas have been put forward to explain how the solar system came to be. Despite the great variety of objects in the solar system, the sun, the planets and their moons, the asteroids, and the comets are not a random collection of bodies but a family with a common origin. We have no evidence that anything in our solar system came from outside except starlight and other kinds of radiation.
The most compelling theories speak of a great cloud of gas and dust that connects the formation of the planets, the asteroids, and the comets with the formation of the sun itself some 4.5 billion years ago.
As the gas and dust began to collapse under the force of gravity, the sun began to form in the dense central region. Smaller collapsing balls of gas formed at various distances away from this central region, giving birth to the planets.
The Asteroid Belt can be thought of as the heap of raw material of a planet that never came to be. It might have formed, if not for the gravitational tug of Jupiter. Jupiter's hefty influence also explains why Mars is quite a bit smaller than Earth and Venus.
The connection between star and planet formation, as well as observations of other stars with disks of matter surrounding them, hints that billions of other stars in our galaxy might have planets. An international planet hunt is underway and since the first discovery, evidence of over 1000 so-called exoplanets has been found. Taken together, these two lines of thought give credence to the idea that collapsing gas and dust form both stars and their associated kingdoms at the same time.