But the law of gravity is essentially synonymous with the theory of gravity.
I disagree with this pretty strongly. The law of gravity is simply that massive objects exert a force on each other witch can be calculated using the law given as a formula. The inverse square law the G in it.
However, a theory has to explain
why that is the case. Newton had, at best a pretty tentative theory and I'm not sure it was really articulated as such. If it was it would be one of uniform space and time with instantaneous forces acting between bodies. What produced the force, beyond the 'mass', isn't explained.
General realitivity is much more robust as a theory even if still not completely explaining the "why". It is also rather different in it's description of space and time yet it gives a law of gravity that, in many circumstances, gives the same answer ans Newton's laws.