newton got gravity by watching a apple fall from his orchid.
.that Newton conceived that the same force governed the motion of the Moon and the apple. He calculated the force needed to hold the Moon in its orbit, as compared with the force pulling an object to the ground. He also calculated the centripetal force needed to hold a stone in a sling, and the relation between the length of a pendulum and the time of its swing. These early explorations were not soon exploited by Newton, though he studied astronomy and the problems of planetary motion.
Correspondence with Hooke (1679-1680) redirected Newton to the problem of the path of a body subjected to a centrally directed force that varies as the inverse square of the distance; he determined it to be an ellipse, so informing Edmond Halley in August 1684. Halley's interest led Newton to demonstrate the relationship afresh, to compose a brief tract on mechanics, and finally to write the Principia.
Book I of the Principia states the foundations of the science of mechanics, developing upon them the mathematics of orbital motion round centres of force. Newton identified gravitation as the fundamental force controlling the motions of the celestial bodies. He never found its cause. To contemporaries who found the idea of attractions across empty space unintelligible, he conceded that they might prove to be caused by the impacts of unseen particles.