It's vast, really really big
But let's just focus on our lil solar system alright?
Billion ans billions of years ago gas and elements mashed together to create a the big bang, expanding and smashing elements together to make the sun, which spat out even more energy ans materials
Further away from this, a huuuuge fight started breaking out between rocks and debris that would clump up due to mass holding density, the greater the density the more attraction ut pulled materials together
Mercury, Venus, Earth and Mars
Gasses were also in the simular affect, but they formed somwhwre further out away from the main, these formed are beloved Jupiter, now this one's important, because they are the biggest, it protects the planets closer due to Jupiter gravity
Then we have Saturn, Neptune uranus and Neptune