How do quasars work?
A binary or supermassive black hole.
A quasar is a large disk of mass that surrounds a supermassive black hole or binary black hole, past the event horizon. In simpler terms it is everything that went into orbit around a black hole.
If you look at any object with large gravity there is a point where the mass gets sucked into the object and there is a point where masses go into orbit around the object. Mercury, for example, is close to the boundary with the sun. Mercury is in orbit around the sun but if it was much closer then it would get sucked into the sun.
Even though the gravity of a black hole is massive it isn't massive enough to create a quasar, it requires 2 or more black holes to combine in order to get enough matter to form a massive accretion disc which is the quasar. Essentially you can think of a quasar as all the planets, stars and other celestial bodies in orbit around the black hole squished into a big disc that can be a trillion times brighter than our sun.