I greatly sympathize with your question. It is indeed a very misleading analogy given in popular accounts. I assure you that curvature or in general, general relativity (GR) describe gravity, they don't assume it. As you appear to be uninitiated I shall try to give you some basic hints about how gravity is described by GR.
In the absence of matter/energy the spacetime (space and time according to the relativity theories are so intimately related with each other it makes more sense to combine them in a 4 dimensional object called space-time) is flat like a table top. This resembles closely with (not completely) Euclidean geometry of plane surfaces. We call this spacetime, Minkowski space. In this space the shortest distance between any two points are straight lines.
However as soon as there is some matter/energy the geometry of the surrounding spacetime is affected. It no longer remains Minkowski space, it becomes a (pseudo) Riemannian manifold. By this I mean the geometry is no longer like geometries of a plane surface but rather like geometries of a curved surface. In this curved spacetime the shortest distance between any two points are not straight lines in general, rather they are curved lines. It is not very hard to understand. Our Earth is a curved surface and the shortest distance between any two points are great circles rather than straight lines. Similarly the shortest distance between any two points in the 4 dimensional spacetime are curved lines. An object like sun makes the geometry of spacetime curved in such a way that the shortest distance between any two points are curved. This is called a geodesic. A particle follows this curved geometry by moving along this geodesic. Einstein's equations are mathematical descriptions of the relation of the geometry to the matter/energy.
This is how gravity is described in general relativity.