According to the nebular hypothesis, stars form in massive and dense clouds of molecular hydrogen—giant molecular clouds (GMC). They are gravitationally unstable, and matter coalesces to smaller denser clumps within, which then proceed to collapse and form stars. Star formation is a complex process, which always produces a gaseous protoplanetary disk around the young star. This may give birth to planets in certain circumstances, which are not well known. Thus the formation of planetary systems is thought to be a natural result of star formation. A sun-like star usually takes around 100 million years to form. The protoplanetary disk is an accretion disk which proceeds to feed the central star. Initially very hot, the disk later cools in what is known as the T tauri star stage; here, formation of small dust grains made of rocks and ices is possible. The grains may eventually coagulate into kilometer-sized planetesimals. If the disk is massive enough the runaway accretions begin, resulting in the rapid—100,000 to 300,000 years—formation of Moon- to Mars-sized planetary embryos. Near the star, the planetary embryos go through a stage of violent mergers, producing a few terrestrial planets. The last stage takes around 100 million to a billion years(wikipedia).
Plz concentrate on this sentence how it is possible that in a rotating medai the objevt which have very low desity accumulate in the center of media as you all well known sun have very low density as compare to its planets.....