The solar system is surprisingly systematic. Certain laws of nature maintain the relationship between the Sun and the planets.
Scientists like Johannes Kepler and Isaac Newton uncovered these secret laws. Kepler's laws of planetary motion govern the rotation of planets. The laws state that planets travel around the Sun in an elliptical or oval path, a planet moves faster in orbit as it nears the Sun, and that there is a relation between its distance from the Sun and the time it takes to complete an orbit. Newton's laws of gravity explain how two objects attract each other.
There is no reason, why the solar system is arranged exactly as it is. It might have been arranged differently, just as there are other solar systems in the Universe arranged differently.