In space each celestial body is attracted by the other celestial body.
It may be sun moon or any other planet.The strength of the Moon's gravitational force is given by Newton's Law of Universal Gravitation

F = G m MMoon / r2Moon

where G if Newton's gravitational constant, m is the mass of the object being pulled on by the Moon.
1 3 1