Nebular hypothesis

The nebular hypothesis states that the Solar System had condensed out of an interstellar nebula that had collapsed, with the planets condensing in orbit around the Sun. Originally proposed by Kant and Laplace in the 18th Century, it became generally accepted in the 19th Century, though a stellar-collision model became popular in the early 20th Century. It was revived in the mid 20th Century, and it has become generally accepted.

Evidence
There are several observations that are most consistent with it. Nebulae are observed that appear to be collapsing to form planetary systems (protoplanetary nebulae) around other nebulae that appear to be collapsing to form Stars (protostars). Variations in the chemical-composition of planets in the Solar System, and cratering rates are also consistent with the nebular hypothesis. The inner Planets and Asteroids are mostly metal silicates and iron-nickel, materials with high boiling points. Yes, most rocks are metal silicates. But the outer planets' satellites and the comets are mostly water, ammonia, and methane ices, with the outer planets also having a lot of hydrogen and helium. These are all materials with low boiling points. Also consistent are cratering rates of objects with relatively low geological activity like the Moon and Mars. They have many more craters than can be accounted for by present-day the frequency of objects that can form craters between the planets of the solar system today, and these are reasonably interpreted as the result of the planets sweeping up leftover material.

Complications
However, there are complications like the numerous "hot Jupiters" that have been observed around other stars, some of which have highly-tilted and highly-eccentric orbits. This suggests that giant planets can spiral inward from their formation orbits and have near-collisions with each other as they do so.