Here's why:
* Nebulae are vast clouds of gas and dust. These clouds are mostly hydrogen and helium, with small amounts of heavier elements.
* Gravity plays a crucial role. Within a nebula, areas with slightly higher density will have a slightly stronger gravitational pull. This causes these denser areas to attract more matter, making them even denser.
* The "domino effect." This process continues, with more and more material being pulled in, leading to a runaway gravitational collapse.
This initial collapse is the spark that ignites the entire process of star and planet formation. It sets the stage for the next steps, such as the formation of a protostar and the accretion disk that eventually gives rise to planets.