These celestial bodies have some peculiar statistics. For example if you were able to take Mount Everest and cram it into your morning cup of coffee you’d achieve the same density as a neutron star.
The reason why these stars are so dense is because they form from the collapse of a star. The way a star keeps its shape is through chemical reactions such as the conversion of hydrogen atoms bonding to create helium. When these bonds occur they produce an outward force in the form of heat. This force is stronger than gravity and keeps the star from caving in.
One of the outcomes when a star runs out of its energy is that it explodes into a supernova and leaves behind a highly dense remnant the size of the San Francisco Bay which becomes a neutron star.
Watch the full video with Enrico Ramirez-Ruiz at UC Santa Cruz: