Think of it this way. Imagine space as a semi-stretchy fabric spread across an open area until taut.
Imagine planets, stars, moons, etc. as different sized and weights of balls and such being placed on this fabric.
So, say, you had two balls that weighed the same but where different sizes. One the size of a baseball, one the size of a basketball and placed them on this stretchy fabric.
The baseball-sized object is going to cause a deeper "hole" in the fabric because it's more dense (takes up less space) than it's same-weighted counterpart, the basketball-sized object.
That "hole" or impression in the fabric is, essentially, what gravity is, and the fabric is the "material" of space. You just have to extrapolate our demonstration into all three dimensions at once.
Take a look at our sun, obviously it creates a lot of gravity. (28g's on the surface IIRC). But if we compressed the sun's mass into the size of Earth it'd be a miniature black hole. Because it's be a lot of mass in a relatively small space to the point it crated a very deep depression in the fabric of space.
(And counter to what Sci-Fi tells us, black holes do not "suck" things into them. They just have strong gravity. If the sun became a black hole the Earth (gravitationally speaking, at least) would remain un impacted. Though it might move closer, but not be "pulled in."