Like all other objects in the Universe, stars are not eternal. They eventually die out, replaced by others that will take their place. However, not all stars suffer the same fate. Depending on their mass, their end can be more or less violent and chaotic.
All stars do not have the same mass and are classified by astrophysicists according to their effective temperature and luminosity. From red dwarfs to blue giants to variable stars, there are several types of stars with different characteristics and properties. Thus, low-mass, intermediate, and high-mass stars have different fates.
Small stars have extremely long lifespans. Due to their small size, they do not need much energy to counter gravitational pressure; they therefore only use their hydrogen reserves. The atmosphere of these stars is constantly circulating and very dynamic, pushing hydrogen from the upper layers towards the core, fueling the fusion reaction.
A typical red dwarf star will burn hydrogen within its core for billions of years. As these small stars age, they become progressively brighter until they break up, becoming an inert, cold mass of helium and hydrogen drifting through the Universe.
When massive stars die, it's a relatively violent end. Due to the increased volume of these stars, fusion reactions must occur much faster in order to maintain balance with gravity. Although they are more massive than their red dwarf cousins, these stars have a much shorter lifespan:in just a few million years, they die out.
But when massive stars die, they go out in all their glory. Their enormous size means there is enough gravitational pressure to not only fuse hydrogen, but also helium, carbon, oxygen, magnesium and silicon. Many of the elements of the periodic table are produced inside these giant stars, towards the end of their life.
However, once these stars form an iron core, that's it. All this material surrounding the iron puts pressure on the core, but the melting of the iron does not release energy to counter this enormous pressure. Instead, the nucleus contracts to such incredible densities that electrons are pushed inside the protons, turning the entire nucleus into a giant ball of neutrons.
This ball of neutrons is able — temporarily, at least — to resist crushing collapse, triggering a supernova explosion. An average supernova releases more energy in a week than our sun will release in its 10 billion years of life. The shock wave and the material ejected during the explosion form bubbles in the interstellar medium, disturb nebulae and even eject material out of galaxies. When supernovae occur in our surroundings, the explosions are bright enough to appear during the day and may even be brighter than the full moon at night.
It is the medium-sized stars that suffer the least envious fate. Too massive to die out quietly and too small to trigger a supernova explosion, they turn into a chaotic intermediary. For these medium stars (which include stars like the Sun), the problem is that once a mass of oxygen and carbon forms in the core, there is not enough surrounding mass to fuse these together. atoms to heavier atoms.
The peripheral layers of the star react to this situation by inflating disproportionately, producing a red giant. When our sun transforms into a red giant, its edge will almost reach Earth's orbit. This red giant phase is unstable, and these stars go through cycles of collapsing/blowing, ejecting large amounts of material around them.
In its final moments, a medium-sized star ejects the rest of its material and becomes an effervescent planetary nebula, thin wisps of gas and dust surrounding the now exposed core of carbon and oxygen at the center. This nucleus takes on a new name when exposed to the vacuum of space:a white dwarf. The white dwarf illuminates the surrounding planetary nebula, transferring energy to it for about 10,000 years before the stellar corpse cools too much to continue producing that brightness.