– Xochielt Sanchez
Answer by Robert Frost:
There are multiple models that attempt to explain the layout of our solar system and the new evidence that comes in on an almost weekly basis from observations of exoplanets will have an influence on those models. So an answer of certitude can't be given.
However, one of the most accepted models is called the Nice model. It says that the solar system was once quite a bit smaller in radius. Neptune was half as far way as it is now. Uranus and Saturn were both closer than they are now. Jupiter was a bit farther way than it is now.
There were more comets and planetesimals in the outer solar system than there are today. Gravitational interactions with the gas giants caused many of those small objects to be pulled inwards and, to conserve momentum, Uranus and Neptune thus moved outwards. Interactions between Jupiter and Saturn also affected the outer planets. And as Jupiter pushed Saturn outwards, it moved inwards a little.
Another factor that contributes to the distance between the outer planets is that those planets are so big because, like Pac-man, they ate everything in their path. It's quite possible that more planets would have liked to form inbetween the gas giants, reducing the orbital spacing. But over time, if the orbital resonances between those bodies is unstable, the larger bodies will either eat, disrupt, or eject the smaller bodies. The reason there is an asteroid belt instead of a planet between Mars and Jupiter is that Jupiter would not allow a planet to form there.
The planets were pushed around until they reached stable states, and when a lot of mass is involved, since gravity is a 1/r^2 influence, that means more distance is required between the bodies.