This is the way we thought about gravity for centuries, and it literally took a genius at the level of Einstein to go beyond it. It isn’t that mass at a certain distance causes a force, but that mass is a type of energy, and energy causes the fabric of the Universe to curve. The fabric of the Universe isn’t just space, but a quantity known as spacetime, where anyone and anything in it experiences space and time together, dependent on how they’re moving relative to everything else in the Universe.
One of the things we learn about a Universe governed by Einstein’s laws — General Relativity — is that it cannot be both static and stable if it has matter in it. A Universe that’s static, where the overall fabric of spacetime doesn’t change over time, would be in trouble if you put matter down into it. Over time, that matter would gravitationally attract, and would draw itself together towards a point. In a static Universe filled with matter, there’s only one possible fate: contracting down to a black hole.
Don’t worry; that’s not our fate.
Because our Universe is doing the one thing it can do to prevent it: it’s expanding. The best way to imagine the Universe is as a loaf of dough in some zero-gravity oven, where the dough is filled with raisins.