The gravitational force exerted by the Sun on the Moon is greater than (about twice as great as) the gravitational force exerted by the Earth on the Moon. Why then doesn’t the Moon escape from the Earth? (e.g. during a solar eclipse)
The moon is, in fact, attracted by the sun and revolves around it. More specifically, the sun attracts the earth-moon system and makes the whole system to revolve round the sun. The attraction of the earth is just a perturbation to the the sun's attraction on the moon. Thus, the path of the moon, as viewed by an observer outise the solar system, is a series of small "circles" superimosed on a large circular orbit round the sun.