Everything in the life of a star depends on its mass. The star's luminosity (that is, how bright it is), its dimensions, surface temperature (thus color). But mass determines also the star's inner or "core" temperature, therefore the type and amount of nuclear reactions that take place in its interior, which in turn determine the amount of energy released (star's brightness) and which chemical elements are destroyed/created.
Also, the life time of a star and its final fate depend on its mass. This is the key to understanding how the abundances and variety of elements have come to exist in the Universe.
Small stars like the Sun burn steadily for over ten billion years. They fuse hydrogen atoms into helium. Yet in all this time they only produce a very small amount of Helium in their inner core (most of the Helium in the Universe comes from the Big Bang). Instead, the most massive stars (up to 100 times more massive than the Sun) burn rapidly and after only a few million years explode as Supernovae (SN), releasing violently into the interstellar medium (ISM) the products of their nuclear burning, plus all the elements heavier than iron (Fe) which "absorbs" energy when produced by fusing lighter elements, and therefore can only be produced in the blast of the supernova explosion. Most of the oxigen in the Universe comes from Supernovae.
Intermediate mass stars, which are too small to become supernovae, but have masses higher or equal that of our Sun, end their life as Planetary Nebulae (PN), again releasing, in a less violent but pictoresque and intriguing way, much of their processed material. Most of the nitrogen in the Universe comes from Planetary Nebulae.
A star is born when a giant cloud of gas and dust collapses under its own [gravitational] weight. Dust only amounts to about 1% of the interstellar clouds, (99 % is gas). However, the dust plays a key role in the formation of stars, and manages to completely obscure some parts of the bright gaseous nebulae. The matter in the interstellar cloud begins to fall towards the center, due to gravity, as apples tend to fall toward the center of the Earth. While condensing and shrinking under the gravitational pull, the gaseous material becomes denser in the centre of the cloud, growing hotter. When the temperature in the inner, dense core, raises to tens of millions degrees, nuclear fusion begins. Hydrogen atoms merge to form helium atoms. These nuclear reactions release a tremendous amount of energy (like a fusion bomb) and bright light is emitted: the star is born!
The huge amount of energy released from the central nuclear reactions stops the gravitational collapse, and the star comes into a balanced state (called "equilibrium"). That is, the energy generated by nuclear fusion in the star's central core is pushing the gas outwards, while gravity is pulling the gas towards the center, and these two opposite forces balance each other. The star remains in this stage for a long time, how long depending on its mass:
But, not even a star lives forever. When all the Hydrogen fuel in the stellar core is used up, no more energy is produced to contrast gravity. The inner part of the star starts contracting again (shrinking) under the gravity pull, and the outer layers expand and cool... the star becomes what astronomers call a "red giant": "red" because its surface is cooler, due to the expansion (white and blue stars are hotter), "giant" because of its increased radius.
All stars become red giants, but what happens afterwards depends very much on their mass. Let's follow three typical cases.
MEDIUM mass stars:
The inner core of the red giant becomes very hot, reaches 200 million degrees and at this temperature helium atoms can be fused to become carbon and other heavier elements. These new nuclear reactions (fusion) again produce much energy. The outer layers (mainly leftover Hydrogen) expand outwards and are illuminated (ionized) by the star in the center, now very hot, forming beautiful, intricate shapes called "Planetary Nebulae". When the helium in the star's core is all used up as nuclear fuel, the core shrinks again (gravity wins again) and becomes very small and extrelemy hot. The star is then called "white dwarf". It still shines, because it is so hot. When all its energy is gone, by shining light, the white dwarf gets dimmer and dimmer, and remains forever a small, very dense cinder (black dwarf). At the density of a black dwarf, we could fit the whole mass of the Earth into a few hundred miles! The material in the Nebula keeps expanding away and diffuses into into interstellar space, the gas of the shell is recycled to form new clouds and eventually new stars. But this gas has been enriched of important elements, especially carbon and nitrogen. The most massive of the intermediate mass stars also produce some iron. Most of the nitrogen and carbon in the Universe come from Planetary Nebulae. New stars and their planets forming from this material will be rich in carbon and nitrogen. Do you think these planets may support life?
MASSIVE stars:
Stars much more massive than our Sun (ten to a hundred times), after becoming red giants, burn helium into carbon, as the intermediate mass stars, but subsequently also burn carbon atoms to form oxygen, nitrogen, and other "heavy" elements all the way up to iron. But iron atoms can not be further used to produce energy by nuclear reactions, because producing elements heavier than iron (Fe) absorbs energy, instead of releasing energy. So, no more nuclear burning is possible. Suddenly nothing can contrast gravity anymore, and the enormous mass precipitates (collapses) towards the terribly hot inner core: the nucleus collapses, the intermediate layers burn instantly, a catastrophic explosion occurs: a Supernova. The star becomes exceptionally bright for days or weeks. The gas in the explosion briefly reaches temperatures of billion of degrees.
The debris from the explosion (the outer layers of our original star) continue to expand by inertia, injecting into the ISM all the new chemical elements that the star has produced in large quantity in only a few million years (for comparison, the Sun lives ten billion years) and the very rare, heavy elements produced in the Supernova explosion itself, such as Gold, Uranium, Led. This material expands into the vast interstellar space, forms new clouds, from which new stars and planets will be born.... will you find gold in the new planets?
SMALL stars:
The vast majority (over 99%!)
of the stars in the Universe are like our Sun or
smaller. They live the longest, most quiet lives among all stars.
They provide
enjoyable light and warmth for a reassuring several billion years.
these small stars die rather quietly.
After the red giant phase, they just
dim and fade, hardly releasing back any of their material to
the interstellar space. Small stars contribute very little
to the chemical enrichment of the Universe.
Wait.... did you say they are not important? Think again!
These are probably the only type of stars around which life
can develop. When stars are too bright and hot,
[probably just a bit hotter than the Sun] life, or at least life similar
to the one we know ( plants, animals, and us, i.e.
``Carbon based'' life),
cannot exist in their solar systems! Planets in a solar system where
life is possible: would you call that uneventful? And small
stars are very numerous.
Supernovae, on the contrary, are very very rare... but they play all
the action, in the production of chemical elements.
You could have a thousands generations of Supernovae
in the lifetime (one generation) of the Sun.
Supernovae are also especially useful to us, producing most
of the oxygen in the Universe.