When a massive star explodes, it collapses into a small dense star. These neutron stars spin very quickly, and emit pulses of radio waves. When the earth is in the way of these waves, we can detect these pulses. So we call the source of these pulses... a pulsar.
Since these pulsars are small, they have a short rotation cycle with regular percise emmissions of light waves. These pulses come in intervals ranging from milliseconds to a few seconds. In fact, these pulses come with such regularity, some of them rival percision of atomic clocks in time measurement.