Newton discovered gravity through observing an apple fall from a tree, realizing that the same force pulling the apple downward also attracts the earth. He then formulated the law of universal gravitation, which states that every object in the universe attracts every other object with a force directly proportional to the product of their masses and inversely proportional to the square of the distance between them. This explains that all objects experience gravitational attraction depending on their mass and proximity to each other.