Here's why:
* Mass and Lifespan: A star's lifespan is primarily determined by its mass. More massive stars burn their fuel much faster and have shorter lives, while less massive stars burn slowly and have longer lives.
* Hydrogen Fusion: Stars like our Sun generate energy through nuclear fusion, primarily converting hydrogen into helium in their core. This process is what keeps them shining.
* Fuel Depletion: As a star ages, it slowly depletes its hydrogen fuel. Eventually, the core becomes mostly helium, and the star begins to expand and cool, transitioning into a red giant.
Important Note: While the average lifespan of a medium star is 10 billion years, there can be variations depending on factors like the star's exact mass and composition.