Newton said that he was looking at the Moon near an apple tree and saw an apple fall. He realized that the same force that makes the apple fall bends the path of the moon into an orbit. Every particle attracts every other with a force proportional to the product of their masses, divided by the square of the distance between them.
All bodies attract each other.
The greater the two masses, the greater the attraction. Gravity is weak between small objects like people, but planets are massive enough to produce significant forces on near objects - gives you your weight. The smaller the distance, the greater the force. Newton was able to derive them using his physics and geometry. He was able to determine the shapes of other types of orbits mathematically related to ellipses.