Neutron stars aren’t so much ‘heavy’ as ‘dense’: they are the smallest and densest kind of star known, with about 1.4 times the mass of the Sun (1.4 solar masses) crammed into a sphere no bigger than 10 kilometres across!
This incredible density comes about because of how neutron stars form. A star is held together by a balance between gravity trying to contract it and an outward pressure created by nuclear fusion processes in its core. When its supply of fuel is exhausted, gravity takes over and the star collapses.
For massive stars between about 8 and 20 solar masses, this collapse squeezes the star’s core to extremely high densities, while the star’s outer layers rebound and blow away in a colossal ‘supernova’ explosion, leaving behind a super-dense neutron star. If the initial star is around 20 solar masses or more, the core collapses into a black hole instead.