That's because it's derived from the universal law of gravitation, which is as follows:
Newton's law of universal gravitation states that any two bodies in the universe attract each other with a force that is directly proportional to the product of their masses and inversely proportional to the square of the distance between them.
Fgravity=GMmd2G=6.67×10−11Nm2kg2