Since stars form in explosive events, it seems painfully obvious that some of the shit that comes flying out does not stick around, and that it could be planet sized/shaped.
The remaining gas and dust that is swirling around the star flattens out into a disk (because of angular momentum). Planets gradually form in this disk, again via accretion (snowball effect).