One of the fundamental concepts of relativity is the principal of equivalence. This principal says that the effects of gravity and the effects of acceleration are indistinguishable. Thus gravity and acceleration are equivalent. Einstein goes on to say that the idea that gravity as a force that attracts masses to other masses is unnecessary. Instead, he says that the presence of mass changes the nature of space-time.
Gravity changes the geometry of space by curving it.
In the absence of matter space-time is flat. The larger the amount of matter, the greater the curvature of space-time. The curvature of space-time is greatest near the massive object and progressively decreases as you move farther away. The curvature of space causes objects to follow curved paths. When the universe is taken as a whole, the size, shape, structure, and dynamics of the whole is determined by the net effect of curvature caused by evey massive object it contains.