As nebula collapses, it becomes denser and hotter and can eventually form a star at its center. The outer edges remain cooler and less dense and form a swirling region of matter that form planets and moons as by-products of the star formation. Star forming region in the nebula NCG 604, in the nearby sprial galaxy M33, as imaged by HST and the Mount Palomar telescope. The hot, dense center becomes a protostar. Something is missing in the theory.
Dust helps collect enough matter to form planets.
Planet Formation Planets form in 3 stages dust grains form condensation nuclei that begin to collect matter the larger clumps of matter begin to stick together and continue to grow until approximately 200 km across. At this stage, the objects are called planetesimals and their own gravity is big enough to attract other matter. Planetesimals are about the size of small moons. Gravitational forces cause the planetesimals to collide and merge until all planetesimal material is swept up into a few large protoplanets. Protoplanets continue to grow and evolve.