Here's how it happens:
1. Gravity: A nebula, a giant cloud of gas and dust, is held together by gravity.
2. Density Fluctuations: Within the nebula, there are slight variations in density. Areas with slightly higher density have a slightly stronger gravitational pull.
3. Accretion: These denser areas attract more gas and dust, further increasing their density and gravitational pull. This process is called accretion.
4. Protostar Formation: As more material is pulled in, the central region of the nebula becomes increasingly hot and dense. Eventually, the core becomes hot enough to ignite nuclear fusion, and a protostar is born.
The protostar will continue to grow and evolve, potentially eventually becoming a full-fledged star.