It’s an optimisation, since in 99% of cases, people will want gravity to affect all objects equally. Otherwise, it’s just a linear force represented by a vector.
This should be fairly obvious; apply a linear force towards the surface or center of the planet.