Shock wave from exploding supernova initiates collapse. Process began about 4.7 billion years ago. Gravity causes collapse to continue. Grains collide and grow into dust balls. These collide and grow into progressively larger bodies.
Planets grow by accretion .
Process ended about 4.6 billion years ago. Fusion begins in core of protostar. Star blows off outer envelope. Super solar wind carries away remains of nebula. Star is now visible from outside.