How do stars form from clouds of gas?
Stars form from vast clouds of molecular gas and dust, primarily hydrogen, through a process called gravitational collapse. When a region of a cloud becomes dense enough, or is disturbed by a nearby supernova or galactic collision, gravity causes that region to contract inward. As the gas falls together, it heats up and the pressure increases. The collapsing cloud fragments into smaller clumps, each forming a protostar at its center.
As a protostar continues to accumulate mass and compress, its core temperature rises dramatically. When the core reaches about 10 million degrees Celsius, nuclear fusion ignites, fusing hydrogen into helium. The outward pressure from fusion balances gravity, and a stable star is born. This entire process can take millions of years.