For stars less massive than about 8 times the mass of our Sun:
* Core: The core collapses under gravity, becoming incredibly dense. The pressure and temperature rise until the core is primarily composed of degenerate electrons (electrons packed tightly together, resisting further collapse). This creates a white dwarf, a small, dense star that slowly cools over billions of years.
* Outer Layers: The outer layers are expelled into space as a planetary nebula, a beautiful, colorful cloud of gas.
For stars 8 to 25 times the mass of our Sun:
* Core: The core collapses even further than in a white dwarf, eventually becoming so dense that neutrons (particles with no charge) are forced together. This forms a neutron star, an extremely dense object with a diameter of only about 20 kilometers.
* Outer Layers: The outer layers are also blown off in a powerful explosion called a supernova.
For stars more massive than 25 times the mass of our Sun:
* Core: The core continues to collapse past the neutron star stage, becoming a black hole, a region of spacetime where gravity is so strong that nothing, not even light, can escape.
* Outer Layers: These layers are blown away in a supernova even more powerful than those resulting from the collapse of lower-mass stars.
In summary:
* Material is compressed: The core of the collapsing star becomes incredibly dense, forming a white dwarf, neutron star, or black hole.
* Material is expelled: The outer layers are ejected into space, creating a planetary nebula or a supernova remnant.
The material that was once part of the star is not lost. It is transformed and dispersed, contributing to the interstellar medium and potentially forming new stars and planets.