How can stars create crystals?
Regular stars like the Sun remain gaseous because they have a nuclear source of energy. But when the Sun dies it will become a large red giant star for a short time, and then a compact white dwarf. Without any source of energy, white dwarfs cool over timescales of billions of years. After a few billion years of cooling the liquid interior abruptly transitions into a solid, which slows down the evolution. It’s much like if you were doing the experiment on freezer water. If you used a thermometer, you would realise that it remains at the same temperature for a while before it cools down more rapidly. The same happens in white dwarfs where the freezer is the dark and empty universe, but the transition happens at 10 million degrees because of the densities involved. The atoms are ordered in a cubic lattice because it minimises the potential energy. The thin surface layers of the white dwarf will remain gaseous for another 10 to 20 billion years until they reach room temperature. After that, the white dwarf is a fully solid crystal and stable for at least 1020 times the current age
of the universe.