The pressure exerted by fermions squeezed into a small box is what keeps cold stars from collapsing. White Dwarfs are held up by electrons and Neutron Stars are held up by neutrons in a much smaller box.
We can compute the pressure from the dependence of the energy on the volume for a fixed number of fermions.
To understand the collapse of stars, we must compare this to the pressure of gravity. We compute this approximately, ignoring general relativity and, more significantly, the variation of gravitational pressure with radius.
The mass of the star is dominated by nucleons.
The pressures must balance.
For a white dwarf, the pressure from electrons is.
A white dwarf is the remnant of a normal star. It has used up its nuclear fuel, fusing light elements into heavier ones, until most of what is left is Fe which is the most tightly bound nucleus. Now the star begins to cool and to shrink. It is stopped by the pressure of electrons. Since the pressure from the electrons grows faster than the pressure of gravity, the star will stay at about earth size even when it cools.
If the star is more massive, the Fermi energy goes up and it becomes possible to absorb the electrons into the nucleons, converting protons into neutrons. The Fermi energy needs to be above 1 MeV. If the electrons disappear this way, the star collapses suddenly down to a size for which the Fermi pressure of the neutrons stops the collapse (with quite a shock). Actually some white dwarfs stay at earth size for a long time as they suck in mass from their surroundings. When they have just enough, they collapse forming a neutron star and making a supernova. The supernovae are all nearly identical since the dwarfs are gaining mass very slowly. The brightness of this type of supernova has been used to measure the accelerating expansion of the universe.
We can estimate the neutron star radius.
Jim Branson 2013-04-22