The solar system is composed of the Sun and objects that orbit it, including 8 planets and their natural satellites like moons. It formed approximately 4.6 billion years ago from the collapse of a giant cloud of dust and gas under the influence of gravity, which caused a star to form at the center to become the Sun and the remaining material to form planets, asteroids, comets and other smaller bodies orbiting it.