The solar system consists of the Sun and objects that orbit it due to its gravitational pull, including planets, moons, dwarf planets, asteroids, and comets. The Sun is at the center of the solar system, with eight major planets orbiting it directly and moons orbiting the planets indirectly. All objects in the solar system, including the eight planets, orbit in the same direction and plane as the Sun rotates, supporting the leading theory that the solar system formed from a collapsing gas and dust cloud.