This is what Einstein's theory of general relativity shows us. The theory also shows us the exsistence of space curvature. Einstein argued that the three dimensions of space could not be separated from the forth dimension of time. Together they form the spacetime continuum. He said that spacetime was not a fixed thing, but could be warped, bent or curved.
Gravity is an intrinsic property of space and heavy stars affect it by causing curvature.
This can be seen in the way our planet circles the sun, or a satellite orbits our planet. They do not travel in a straight line, but in a curve. I have found that, for me, space curvature is most easily pictured if you try to imagine flat beings living in a flat world. They have length and height, but no width and their world is an infinitely large flat plane, that can be thought of as a large piece of sheetmetal. At some critical size the plane would actually fold over onto itself.