The rotation of planets and the Sun is primarily attributed to the conservation of angular momentum, as particles falling into a gravity well tend to travel in a spiral path, preserving momentum and imparting spin to the forming celestial bodies. Larger bodies in the solar system maintain their rotation due to minimal external influences, while smaller bodies experience tidal forces that synchronize their rotation with their revolution. For instance, Earth's gravitational influence has caused the Moon to rotate once per revolution, and the Sun has similarly affected Mercury's rotation. This synchronization is common among many moons in the solar system. Overall, the dynamics of rotation are influenced by gravitational interactions and the initial conditions of formation.