To compute the attraction that an extended body, such as the Earth, exerts on a point, one has to add up the attraction of every little piece of the body. Lagrange and Laplace realised that it was simpler to work with a single function, the potential: the sum of the masses of each piece divided by their distance to the point, $$V(x, y, z) = \int \frac{\rho\,dv}{r},$$where $\rho$ is the density. The attractive force is obtained by differentiating $V$.