We don't really know.
Current theory models gravity as a curvature of spacetime. Objects follow null geodesics (fancy phrase for 'straight lines') through this curved space so that, to our eyes, they appear to curve (like how a baseball curves back toward the ground).
It is the presence of mass that curves space, so anywhere there is mass (even the smallest atom), there will be some curvature of spacetime.
Mass tells spacetime how to curve; spacetime tells mass how to move.
There are a gazillion PF threads on the this topic for the reading.