The "fabric" thing is basically an analogy for convenience of explanation, and shouldn't be taken too literally. Let's see if I can remember enough of my physics texts this early in the morning...
First off, Einstein showed that every observer has to measure the same speed of light, no matter how fast or in what direction the observer is moving relative to the light. That seems weird -- if something's moving toward you at speed X and you move toward it at speed Y, it should seem to move at speed (X + Y) relative to you. But light isn't just any old thing. The speed of light in a vacuum, c
, is fundamental to many physics equations; changing it would change the laws of physics. But the same laws have to apply equally to everyone, so every observer has to see the same constants, including the same speed of light.
So that's the why, but what's the how? What ensures that every observer sees the same value of c
regardless of their own motion? Well, a measurement of speed includes two components, distance and time (miles per hour, meters per second, that sort of thing). So you can change how someone perceives the speed of something if you change the way they perceive distance and time. Basically, when you're moving or accelerated, your measurements of space and time change in such a way as to cancel out any changes you'd observe in the speed of a beam of light as a result of your motion.
Ditto for acceleration, since acceleration changes how you move. And gravity is basically an acceleration, something that changes your speed and direction of motion. So being in a gravitational field is going to alter your measurements of space and time. But this is not an illusion; in relativistic physics, what you measure is what's real for your particular frame of reference. But an observer in a different frame of reference will see your measurements as distorted relative to theirs; because of the gravitational acceleration, you and they will have different measurements of the distances and directions of motion around a massive body depending on your positions relative to it. What would be a straight, unaccelerated trajectory in flat space (i.e. a geodesic, a fancy word that basically means "the shortest distance between two points") would be a curved, accelerating trajectory around a massive body. So since the massive body changes the geodesics around it, alters the way that objects and even beams of light move around it, it's effectively changing the geometry and topology of space and time themselves.
But that's not an easy concept to get across, so it's simpler to talk about changing the shape of something by analogy with something familiar like a flexible fabric or a rubber sheet. The sheet with the heavy marble distorting its shape is a handy analogy for the geometry
of a massive body's gravity well (albeit with one dimension subtracted for easier visualization), but not for its causes