Here's why:
* Nuclear Fusion: Stars shine because of a process called nuclear fusion, where hydrogen atoms combine to form helium, releasing immense amounts of energy in the form of light and heat.
* Fuel Supply: The amount of fuel (hydrogen) a star has dictates how long it can shine. Larger, more massive stars burn through their fuel much faster than smaller stars.
* Lifespans:
* Massive stars: Live for a few million years.
* Sun-like stars: Live for about 10 billion years.
* Small, red dwarf stars: Can live for trillions of years!
So, while some stars have lifespans measured in millions of years, many others, including our Sun, can shine for billions of years.