Between 4 and 5 million years ago, a huge cloud of dust and gas collected around the region in which the solar system is now. There is a collapse in the cloud under the force of gravity, which in turn caused it to spin rapidly. This spinning resulted in a disk shape. And solid elements began to connect and broke apart into small objects. As these planetesimals collided and captured each other, formed the planets now.. The sun radiates light and heat. The terrestrial planets were formed from materials that did not disintegrate at high temperatures, while the Jovian planets could be condense at much lower temperatures. Asteroids and comets were also swirling around the system.
Modern high speed computers allow us some experiments by modeling events. They find out that the nebular hypothesis is valid in the universe. These modeling experiments shows that the planetary formation is to be a natural consequence of the process. This process initiates the birth of a star. Planetarty systems are not a exception but the rule. It would say that there will be planets in another solar system where life is possible.