The outer planets have many moons, like miniature solar systems. Some moons appear to have formed in place around their planet, others appear to have been captured from elsewhere. We have discovered many patterns in the solar system. Our Sun and solar system started 4.6 billion years ago . The cloud began to collapse due to gravity.
Gravity pulls things together.
When I let go of this eraser, gravity pulls it and the earth together. The eraser gains energy as it falls, the energy becomes heat and sound when the eraser hits the floor. The infalling material heats up, a hot nebula. The nebula probably had a slight rotation to begin with, maybe because it is part of the larger rotating Milky Way galaxy. As the nebula contracted in size, its spin increased.