Stellar evolution is the process by which stars change over their lifetimes, ranging from millions of years for massive stars to trillions for the least massive. Stars are born from nebulae of hydrogen and dust and evolve through stages like red giants and supernovae. Supernovae occur when massive stars explode, leaving behind neutron stars or black holes. Neutron stars are incredibly dense, while black holes have such strong gravity that nothing can escape.