The birth of a star is a mysterious process.
Hydrogen gas collapses into a tight knot to build the star. A swirling pancake disk of dust and gas encircles the newly forming star. The disk is not smooth but clumpy and turbulent. The clumps pull in more dust, through gravity, and grow in size until they become planets around the star. Scientists don’t know for sure if all stars have planets, but it seems unlikely that only certain kinds of stars would have planets.