The heat and energy generated in a star's core want to make it expand, while the star's gravity wants to make it contract. The perfect balance between the two can keep a star shining stably for billions of years. Eventually, however, a star runs out of fuel in its center. When this happens, there is no longer a generation of heat and energy in the interior, and nothing is present to counteract the self-gravitation of the star. After a supernova explosion, all that's left of the original star is the core - called a neutron star .
Neutron stars are very small by astronomical standards.
Our own Sun's radius is 100 times bigger than the radius of the Earth. At the same time, a neutron star contains up to 1.5 times as much matter as the Sun, making the density of these objects tremendous. Neutron stars also have very large magnetic fields. The magnetic field is so strong that it causes most of the light and radiation that the neutron star emits to be concentrated into cones of emission, like beams from a lighthouse. In fact, the key to a pulsar is the combination of the extraordinary magnetic field and the rotation of a neutron star.