When the galaxy was first being formed, the gases were swirling around, so as the solar systems formed, they tended to be circling around the centre of the galaxy in the same plane and direction of orbit. Then as a the star and planets formed in each solar system, they tended to be circling around the centre of the solar system in the same plane and direction of orbit … which because of the movement of each solar system, they tended to be in the same plane and direction of orbit as all the other solar systems .. and so on. This is related to something called the conservation of angular momentum which describes how things rotate.
Is it the case that all the solar systems are rotating in the same plane as the galaxy? Didn’t know that. Either way, at a local level (so, within a solar system) as gases clumped together to form stars, there was a natural move towards things rotating.
Why? If you imagine a few objects distributed in space. There’s gravity, so they attract each other. They start to move towards each other. Now if everything was perfectly symmetrical, they would come together and meet and stop. The chances of that are basically zero. They won’t all meet perfectly, and some of the particles will in any case be moving a bit. These random variations, when you have a million particles, will, ON AVERAGE, result in some overall circular movement of the whole thing. It’s like they’re all orbiting each other before they collide.
So a big cloud of gas, when it collapses due to gravity, will tend to start rotating. It gets the energy to do this from collapsing in the first place. Now again, ON AVERAGE, and over time, all the particles will rotate in the same direction, after they have stopped colliding.
So our solar system began like that. The stuff at the centre became the sun, and the stuff that didn’t quite make it, but formed local clumps further out, became planets. Because the whole gas cloud formed in one go, and the whole thing was rotating in one direction, the planets all orbit in the same plane. Perpendicular to the axis of rotation.
People have built models of this in computers and the simulations are pretty good. Never turns out the same each time. What we see is a random output of planet sizes, but I think that in each case the planets all orbit in the same plane. If they don’t (like with Pluto) you assume that that thing came to the party late, or formed from a collision long ago that sent it flying.
The planets in our solar system aren’t actually in a line like you might have seen them in pictures, they are orbiting constantly around the Sun. So it looks more like an athletics track with the sun in the middle, and the planets running around the outside at different speeds.
On Earth, if you throw something into the air it will fall back down again. This is because of gravity; the Earth pulls things toward itself. The Sun does the same thing, but it has a much larger mass so it is able to pull Earth and all the other planets toward it. The reason we don’t get sucked into the Sun though is inertia: the idea that an object will move in a straight line at a constant speed unless other forces act upon it.
So if you threw a tennis ball out in space it would move in a straight line at the speed it was going when it left your hand. It would move like this forever unless it bumped into something which changed its direction, or got caught by the gravity of a planet or star (things on Earth don’t do this because of gravity and friction caused by particles in our atmosphere). A tiny thing like a tennis ball would be sucked straight into the sun because it has a tiny mass. The planets have much larger masses, so although they are pulled in by the gravity of the sun, they still try to keep moving in that straight line at a constant speed. This leads to them orbiting around the sun, balanced between the pull of gravity and trying to move in a straight line.