Sir Cumference\’s answer is great. Molecular clouds are generally thousands of times more massive than the Solar System, and since they\’re less dense they\’re much much larger in volume. We don\’t know where our Solar System originated from, and we don\’t know how many other stars were born in the same cloud, probably hundreds or even thousands (just recently 1 or 2 stars were suggested to be sisters of Sol, but the jury is, as far as I know, still out on that). Anyway, either due to interstellar winds, magnetic fields, supernovae explosions, or some other difference in average density, a volume of our mother molecular cloud began to collapse due to gravity being just a bit more in some areas. The more the cloud became concentrated, the more the gravitational attraction increased, so the faster it collapsed. While dust and gas collide, the whole system conserves energy and momentum (as it is an isolated system), and thus is naцve to assume that planet orbits should be random Б which means
any which way, you seem to have assumed that space is two dimensional, and the most random arrangement would be a flat disk. Nope. It would be a sphere. like a swarm of flies around something stinky. When we program a computer to model a swarm of random dust and gas collapsing, it turns out that due to chance it will select a preferred direction. A random dust cloud will collapse into a disk with most of the particles orbiting in the same direction (this ignores possible effects from the Milky Way influencing the process, so even without the molecular cloud orbiting the center of the Milky Way, disk formation will occur).
Keep in mind that these answers are tentative: most of the gravity in the Milky Way is of dark matter, and we\’re still working on understanding how that influences star formation and until we know a lot more about dark matter, we can\’t be sure our computer models are correct. Generally, we prefer models that give results similar to the actual way our Solar System is. But guess what? The thousands of exoplanets we\’ve discovered have far more \”hot Jupiters\” (gas giants very close to their stars) than we expected. So we are adjusting our models. One popular idea is that planets had a lot more collisions than we used to think. This means more planets in very close to the Star, and more planets actually ejected from the star system. Who knows, perhaps that\’s where Theia came from. All planets in a planetary system should orbit in the same direction. However, this direction varies among different planetary systems. The direction that planets will orbit, for any planetary system, depends on the molecular cloud that formed them. The reason for this is conservation of angular momentum. Before a star and its planets exist, thereБs just a cloud of disorganized gas and small molecules.
The Solar System formed from such a cloud around 4. 6 billion years ago. On that scale, there is some small amount of rotation within the cloud. It could be caused by the gravity of nearby stellar objects, local differences in mass as the cloud churns, or even the impact of a distant supernova. The point is, all molecular clouds have at least a little rotation. The direction depends on a number of factors, so some clouds will turn clockwise, and others will turn counterclockwise. In a large system like a molecular cloud, each particle has some angular momentum, and it all adds together across a very wide area. ThatБs a lot of momentum, and it is conserved as the cloud continues to collapse under its own gravity. That angular momentum also flattens the cloud, which is the reason why the Solar System is near-planar. When the cloud finally collapses, it forms a star and shortly after planets. However, angular momentum is always conserved. That\’s why all the Solar System planets follow the same orbit, and why almost all of them rotate in the same direction. There\’s nothing to turn them the other direction, so they will continue spinning in the same direction as the original gas cloud. There are a few exceptions, though. Whenever objects formed in such a way that sent them orbiting the opposite direction, they usually collided with objects going in the same direction as the original cloud.
This destroyed any outlying objects or sent them in the same direction as the original cloud. Still, two huge exceptions are planets Venus and Uranus. Uranus spins on an axis of almost 90-degrees (on its side). Venus meanwhile spins the opposite direction as Earth and the other planets. In both cases there is strong evidence that these planets were struck by large objects at some point in the distant past. The impacts were large enough to overcome the angular momentum of the bodies, and give them a different spin. There are also a range of other theories; for example, some astronomers think that Venus may have been flipped upside-down. Point is, there were irregular events that happened to both of these planets. Overall, what I described applies for all planetary systems. To answer your question, it depends on how their cloud rotated. The cloud that formed some planetary systems may have turned counterclockwise, just like for the Solar System (at least, it appears counterclockwise from above Earth\’s north pole). The cloud for others may have turned clockwise. That\’s why not all exoplanets systems will have the same orbital direction as Earth; however, typically all planets in a planetary system will share the same orbital direction.