These stars are bigger several times than that of sun. They are formed as a result of a supernova. Supernova is an explosion of stars, when these stars have running out their nuclear fuel, they explode. When they explode their materials, electrons and protons, squeeze together to become neutrons so that why we call them neutron stars. A neutron star is very heavy because the neutrons are tightly crammed together into a super dense object that one sugar cube of its material weighs about 100 million tons, which is about as much as a mountain. Therefore as a star gets smaller, its mass gets heavier.
A Neutron star has a very high rotation speed. It can spin several hundred times per second. That creates intense magnetic fields around it and when it rotates, it produces a sound similar to a hammer, So that why the astronomers call it 'a gigantic hammer'.