Thank you for the opportunity to help you with your question!
One of the earliest theories for the formation of the planets was called the encounter hypothesis. In this scenario, a rogue star passes close to the Sun about 5 billion years ago. Material, in the form of hot gas, is tidally stripped from the Sun and the rogue star. This material fragments into smaller lumps which form the planets. This hypothesis has the advantage of explaining why the planets all revolve in the same direction (from the encounter geometry) and also provides an explanation for why the inner worlds are denser than the outer worlds.
However, there are two major problems for a theory of this type. One is that hot gas expands, not contracts. So lumps of hot gas would not form planets. The second is that encounters between stars are extremely rare, so rare as to be improbable in the lifetime of the Universe (15 billion years).
A second theory is called the nebular hypothesis. In this theory, the whole Solar System starts as a large cloud of gas that contracts under self-gravity. Conservation of angular momentum requires that a rotating disk form with a large concentration at the center (the proto-Sun). Within the disk, planets form.
While this theory incorporates more basic physics, there are several unsolved problems. For example, a majority of the angular momentum in the Solar System is held by the outer planets. For comparison, 99% of the Solar System's mass is in the Sun, but 99% of its angular momentum is in the planets. Another flaw is the mechanism from which the disk turns into individual planets.
Please let me know if you need any clarification. I'm always happy to answer your questions.
Content will be erased after question is completed.