A huge amount of what your brain does is keep other parts of your brain from speaking out-of-order. The most energy intensive parts of the brain functions are those ones, so they fail first. When that happens you get a lot of brain noise or different bits talking over each other. That can happen in other instances too, often called a "seizure".
post
It doesn't take much going wrong to "hallucinate" light, its not that you physically produce the light the eye starts to see. Its just a byproduct of the processes happening
Visual processing is an overlay that happens on top of sensory data. You can actually meditate to the point of getting some of that processing to shut down while you are still alive. (See Buddhist 6th fetter as an example) One of the outcomes of this kind of training is that all things are said to shine with their own internal light and become "heavenly". In relation to your question, it would really just be a modification or a failing of that visual overlay that your brain adds to your visual data all the time.
Maybe only the synapses related to the visual cortex?
I know nothing about brains so I’m it’s guessing.
all 4 comments