Since our solar system is already formed, we must try to reconstruct its history by studying current star formation in our local neighborhood, the Milky Way galaxy.
The best model of our solar system's history states that it formed from the collapse of a single interstellar cloud that may have been as large as a light-year across—10 million times larger than the diameter of the sun. The cloud was likely irregular in shape, perturbed by neighboring stars and other clouds. As it compacted and cooled, the cloud's own gravity overpowered any forces acting to stabilize the system. It then proceeded to contract dramatically.
Prior to its collapse, the original cloud probably began with a fixed mass and a slight, random rotation relative to some central axis. This kind of rotational motion is measured by its "angular momentum," which is directly proportional to the system's mass multiplied by the rate at which its material sweeps out area around the rotational axis. A fundamental principle of physics is that angular momentum, like energy, is conserved. As the cloud collapses, both its mass and angular momentum remain constant. Since the rate at which area is swept out is fixed, a smaller cloud has a shorter period of rotation and a contracting cloud "spins faster" with time. A famous example of this phenomenon is the spinning ice skater who pulls in her arms and consequently rotates faster.
As a rotating cloud of interstellar gas collapses, it also tends to flatten. In the case of our solar system, most of the initial interstellar mass helped form the sun. The portion of the mass with the most angular momentum remained in a disk, which then orbited the sun. We believe that the planets formed out of this disk, and therefore the sun is naturally found at the center of this event. Although the sun has about 1,000 times the mass of Jupiter, the orbital motion of Jupiter has a larger angular momentum than the sun, seeing as they both sweep out space around the sun's center.
With modern telescopes we observe disks around young stars, which seems to indicate that these rotating disks that become planets come into being when a star is formed. Current observations show that at least 5 percent of stars that are similar to the sun possess Jupiter-like planets. The fraction of stars surrounded by planets may actually be much larger than that figure.