the sun can be seen as this kind of valley in spacetime, and one of the other objects in the valley (i.e, spacetime) is the earth. the earth does not roll directly towards the sun (or ball) because it is moving too fast. the force pulling the earth towards the sun is about the same as a second force. this second force is called the centrifugal force. the centrifugal force exists because the earth moves sideways. this sideways motion makes the distance between the earth and sun increase. since the earth is being pulled towards the sun and moving away at the same time, it stays at about the same distance. this is also how the moon orbits the earth. in this second case, earth is the ball and the moon is the object. however, this valley example to demonstrate gravity is insufficient because spacetime fabric is actually four dimensional, whereas valley's example implies two dimensional spacetime. sun and other objects with mass curves four dimensional spacetime fabric. valley example is just analogy and not 100% reality.