The formation of the Solar System began about 4.6 billion years ago from a giant cloud of gas and dust called a solar nebula. Gravity caused this cloud to collapse, leading to the formation of the Sun at its center. As the material continued to clump together, it formed a rotating disk where planets, moons, and other celestial bodies began to take shape.
Within this rotating disk, small particles collided and stuck together, gradually forming larger bodies known as planetesimals. Over time, these planetesimals merged to create the planets we know today, including Earth, Mars, and Jupiter. This process of accretion led to the diverse range of objects in our Solar System.