A star does not collapse in its early stages due to the strong radiation pressure generated by fusion reactions in its core, primarily fueled by hydrogen. As a star ages, it exhausts its hydrogen supply and begins fusing heavier elements like helium and carbon, leading to a decrease in energy output. Eventually, when a star can no longer sustain fusion reactions, it loses the energy needed to counteract gravitational forces, resulting in collapse. Throughout most of its life, a star loses minimal mass, primarily through solar wind, while the fuel converts to helium, remaining within the star. Cepheid variables illustrate this process, as they undergo cyclical collapse and expansion over billions of years.