Cats’ eyes seem to glow because of a reflective layer behind the retina called the tapetum lucidum.
The eye gets a second chance at the light
Light enters the eye and reaches the retina.
Some light passes through without being absorbed.
The tapetum reflects that light back toward the retina.
That gives light-sensitive cells another opportunity to detect it.
Why is that useful?
Cats are adapted for low-light activity.
Large pupils, many rod cells in the retina, and the reflective tapetum help them make better use of dim light.
They still cannot see in absolute darkness.
There has to be some light to work with.
Why can we see the reflection?
Some reflected light exits the eye again.
If you are near the original light source, such as a flashlight or camera flash, that returning light can travel toward you.
The result is eyeshine.
Why can the color vary?
The color depends on eye structure, pigments, viewing angle, and incoming light.
Green and yellow are common.
Is this what fireflies do?
No.
A firefly creates light chemically.
A cat’s eye is only reflecting existing light.
The visual system is also part of why goats have unusual horizontal pupils, though goats solve a very different problem.
Cats’ eyes are not making light.
They are extremely good at sending available light back through the eye.
And that’s the short explanation.
Related explanations: Why do goats have rectangular pupils?, Why do cats have whiskers?, and Why do cats slow blink?