Gravity can be thought of as a force, always an attractive force between any objects that have mass.
As time has gone on, the description of what gravity is has changed. At the moment it is thought of as a result of space and time (they are part of the same thing really, known as spacetime) curvature.
Our description of it is incomplete, we don’t know how gravity behaves on really small scales, so the answer to this question is at the moment at least, incomplete.