At the time of Newton it was perfectly understood that there existed a force called ``gravity'' that made all objects fall to the ground. Newton conjectured that the same force was responsible for the Moon orbiting the Earth and the planets orbiting the Sun.
If that was indeed the case, the force acting on the Moon should be about
3600 weaker than the force causing objects to fall to the ground.
Since the distance to the Moon was about 60 times the size of the Earth,
the force of gravity had to obey the inverse square law:
Using the inverse square law for the gravitational force, Newton was able to derive all three Kepler's law of planetary motions.
Using additional arguments, Newton finally arrived at the formula that
gives the force of gravity between two objects with masses M1 and
M2:
If one of the objects is much larger than the other (as, for example,
the case of the Sun and a planet), then the mass of the larger object
is usually denoted by M, and the mass of the smaller object
is denoted by m:
We can now understand why all objects fall to the ground with the same
acceleration (and, thus, in the same time if they fall from the same height).
From Newton's second law:
In the equation:
The third law of Kepler:
What is important is that the relationship between the size of a system (in this case R) and the measure of how fast objects are moving (in this case the period P) depends on the total mass of the system. Thus, if we know the size of the gravitating system, and how fast objects inside this system are moving, we can apply an appropriately modified form of the Kepler's law to measure the total mass of the system - this is one of only two direct ways to measure masses of astronomical objects.