One of the differences between astronomy and astrophysics is that astronomy is based upon observation, while astrophysics is about the underlying mechanism behind those observations. For this reason, many types of phenomena in the universe have multiple names depending on how we observe them. The reason for this is that typically astronomers start observing different phenomena, give them names, and then only later do astrophysicists figure out that they are different examples of the same thing. By then the names have already stuck.
I’ve talked about this before where radio galaxies, quasars and blazars are all caused by supermassive black holes in the center of galaxies. A similar thing occurs with neutron stars. A neutron star is the remnant of a supernova. When a large star explodes, the core of the star collapses into an object so dense that it is comprised almost entirely of neutrons. Depending on its formation, orientation and surrounding environment, it can also be known as a pulsar, magnetar or x-ray binary.
A pulsar is neutron star that appears to pulse rapidly, usually at radio frequencies, but sometimes in the visible and even x-ray spectrum. You can see an example in the animated crab pulsar image here. A neutron star typically has a very strong magnetic field. This magnetic field can interact with surrounding ionized plasma to create intense electromagnetic beams that are directed from its magnetic poles. The magnetic poles are typically offset a bit from the neutron stars rotational poles, so the poles (and the beams) rotate around, similar to the way a lighthouse sweeps around a beam of light. If the beam is oriented so that it sweeps in our direction, we see a pulse of energy. The rate of rotation for the neutron star determines the rate of pulses we see.
A magnetar is a neutron star with an extremely strong magnetic field. They also tend to rotate more slowly than other neutron stars. Because of the strength of their magnetic fields, their polar beams are typically x-rays and gamma rays. They also geologically active, and can have starquakes (similar to earthquakes on Earth). These realignments of the magnetar’s crust can create large gamma ray flares, such as seen in soft gamma repeaters.
If a neutron star has a companion star, then it can become an x-ray binary. In this case the neutron star captures some of the material from the outer layers of the companion star. As the material falls toward the neutron star it is accelerated and heated, causing it to emit x-rays. The result is an x-ray source that is part of a binary system. X-ray binaries can also be caused by white dwarfs and black holes.
Sometimes what appears to be radically different phenomena can have a similar cause.