What two factors keep Earth in orbit and around the sun and the moon in orbit around Earth

The two factors that keep the Earth in orbit around the sun and the moon in orbit around the Earth are gravity and the velocity of the objects. Gravity is the attractive force between two objects with mass, such as the sun and Earth, or Earth and the moon. This gravitational force is what keeps the objects in orbit around each other.

Additionally, the velocity of the objects is important in maintaining their orbits. The speed at which Earth orbits the sun and the moon orbits Earth is just right to balance the gravitational pull, keeping them in their respective orbits. If the velocity were too slow, the objects would be pulled in by gravity and crash into the larger object. If the velocity were too fast, the objects would escape the gravitational pull and drift off into space.