* Gravitational Collapse: When a star runs out of fuel, it can no longer support itself against its own gravity. The core collapses inward, squeezing the matter into a much smaller volume.
* Electron Degeneracy Pressure: As the core collapses, the electrons are packed closer and closer together. This creates a powerful pressure called electron degeneracy pressure, which resists further collapse. This pressure is what ultimately stops the core from collapsing into a black hole.
* Loss of Outer Layers: During the collapse, the star sheds its outer layers in a planetary nebula. This leaves behind a small, dense core – the white dwarf.
To illustrate the density:
* A teaspoon of white dwarf material would weigh several tons!
* The average white dwarf is about the size of the Earth, but contains the mass of our Sun.
In summary: White dwarfs are incredibly dense due to the intense gravitational collapse of a star's core, leading to a compressed state where electrons are forced into a highly degenerate state, providing a strong counterbalance to the gravitational force.