First off, you must understand what quasars are. The term quasar derives from how these objects were originally discovered in the earliest radio surveys of the sky in the 1950s. Some radio sources, however, coincided with objects that appeared to be unusually blue stars, although photographs of a percentage of these objects showed them to be embedded in faint, fuzzy halos. Because of their almost starlike appearance, they were dubbed “quasi-stellar radio sources,” which by 1964 had been shortened to “quasar.”
Continuing observations of quasars revealed that their brightness can vary significantly on timescales as short as a few days, meaning that the total size of the quasar cannot be more than a few light-days across. Since the quasar is so compact and so luminous, the radiation pressure inside the quasar must be huge; indeed, the only way a quasar can keep from blowing itself up with its own radiation is because it is very massive, at least a million solar masses if it is not to exceed the Eddington limit—the minimum mass at which the outward radiation pressure is balanced by the inward pull of gravity (named after English astronomer ). Astronomers were faced with a conundrum: how could an object about the size of the solar system have a mass of about a million stars and outshine by 100 times a galaxy of a hundred billion stars?
By 1965 it was recognized that quasars are part of a much larger population and most of these are much weaker radio sources too faint to have been detected in the early radio surveys. This larger population, sharing all quasar properties except extreme radio luminosity, became known as “quasi-stellar objects” or simply QSOs. Since the early 1980s most astronomers have regarded QSOs as the high-luminosity variety of an even larger population of “active galactic nuclei” or AGNs. (The lower-luminosity AGNs are known as “Seyfert galaxies,” named after the American astronomer Carl K. Seyfert, who first identified them in 1943.)
As a result, it can be seen that quasars, viewed as distant star like objects which may vary slightly in luminosity over time, are not prone to the type of sudden bursts we associate with explosive supernova ejecta or a gamma ray burst.
First discovered in the 1960s by U.S. military satellites looking for covert nuclear tests, and when first discovered they nearly triggered a USAF airborne alert, gamma-ray bursts are short-lived explosions of gamma rays, the most energetic form of light. Lasting from a few milliseconds to several hours, they shine hundreds of times brighter than a typical supernova and about a million trillion times as bright as the Sun. Observed in distant galaxies, they are the brightest electromagnetic events known to exist in the universe. A typical burst releases as much energy in a few seconds as the Sun will in its entire 10 billion year lifetime.
Gamma-ray bursts do not come from any particular direction in space, though they are associated with very faint galaxies at enormous distances. The explosions are thought to be highly focused, with most of the energy collimated into a narrow jet traveling near the speed of light. We can only detect the jets of gamma-ray bursts pointed directly at us.
Imagine, if you will, a light house with the two collimated beams. Each beam, as it sweeps across the horizon could equate to a beam of high energy gamma rays. We only see it when it flashes.
Astronomers classify gamma-ray bursts into long- and short-duration events. While the two types of events are likely created by different processes, both result in the creation of a new black hole. Long-duration bursts last anywhere from 2 seconds to several hours. Although they are associated with the deaths of massive stars in supernovas, not every supernova results in a gamma-ray burst. Short-duration bursts last less than 2 seconds. They appear to result from the merger two neutron stars into a new black hole, or the merger of a neutron star and a black hole to form a larger black hole.
In 2017, NASA’s Fermi telescope observed that a short-duration gamma-ray burst was tied to the gravitational waves detected by the National Science Foundation’s Laser Interferometer Gravitational-Wave Observatory (LIGO). A pair of colliding neutron stars was thought to have created an immensely explosive kilonova, (a kilonova, also called a macronova or r-process supernova, is a transient astronomical event that occurs in a compact binary system when two neutron stars or a neutron star and a black hole merge or collide into each other) along with the gamma-ray burst and the gravitational waves. Hubble set out to observe the kilonova and capture its near-infrared spectrum, which revealed the motion and chemical composition of the expanding debris. The spectrum looked exactly how theoretical physicists had predicted the outcome of the merging of two neutron stars would appear.
In essence, quasars are long term events associated active galactic nuclei, while gamma ray bursts are tied to the collision or merging of neutron stars together or with a black hole and has a short lived explosive appearance. (See Britannica and Hubblesite.org for vastly more information on both items)