* Gravity and Distance: While the Sun has a much stronger gravitational pull overall, the Earth's gravitational pull is significantly stronger on the moon because it's much closer. The strength of gravity decreases rapidly with distance.
* Orbital Mechanics: The moon is within the Earth's "Hill sphere," a region where Earth's gravitational influence dominates over the Sun's.
Think of it like this: Imagine you're holding a small ball near a large boulder. The boulder has a much greater mass, but the ball is closer to you and feels your pull more strongly.
The Earth's moon is in a delicate balance between the Earth's and Sun's gravity. It orbits the Earth due to the Earth's stronger gravitational influence at that distance.