Final answer:
Stars generate light through the fusion of hydrogen into helium, and a star's life course and end are largely determined by its mass, with gravity playing a key role in star formation and the creation of black holes.
Step-by-step explanation:
Stars generate light when hydrogen atoms become helium atoms during fusion. What happens at the end of a star's life is determined by its mass. The force of gravity pulls matter into protostars and traps light in black holes.
During a star's life, as hydrogen is fused into helium in the core, it produces energy in the form of light and heat, a process crucial for the star's stability. The reactions that fuel a star change its chemical composition, affecting its temperature, luminosity, size, and even its lifespan. The fate after hydrogen is exhausted depends heavily on the star's mass, with more massive stars having more dramatic endings, potentially becoming neutron stars or black holes.