The "white flash" is caused by a sudden movement of the brain; kind of like a minor concussion without the bruising that can lead to more serious problems.
This rapid impact can disrupt the flow of blood in that area, and can also affect the huge amount of nerve cells at the back of the head. This rapid movement of the skull and its impact on the brain is what causes us to “see stars”, because the occipital lobe is where the visual cortex is located.
If you're hit, you might experience a flash of light, a brief blackness, blurred vision and a weird "thock" sound, all depending on the severity of the blow. But what happens inside your head? That's another story.
If the motion of your head halts abruptly, inertia forces your brain forward. When that happens, your brain experiences a "coup" (smacking against the front of your skull) and a "countercoup" (the same feeling, but at the back of the skull).