The answer is gravity. According to general relativity by Einstein, the bending of space-time is dependent on the nature of the matter of the object, or energy, momentum, and radiation. The heavier the object, the bigger the curvature of space-time it causes, that is felt as gravity. Heavier objects with a bigger gravity pull, pull other objects (with lesser gravity pull) more towards them than vice versa.