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. Kapler’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 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.