A sudden impact can cause your brain to bounce back and forth within your skull. This squishing of your brain disrupts the flow of blood to different areas of your brain, primarily the occipital lobe. This disturbance is what causes us to see stars when we hit our heads or stand up too fast.
The human brain is ~83% water. This makes it very “jiggly” and gives it an almost jello-like consistency. When you encounter an impact (hitting a cabinet door, getting punched in the face, or walking into a wall), your brain bounces back and forth inside your skull. This disrupts the blood flow inside your brain. Your occipital lobe sits in the lower back portion of the brain. This part of the brain is what allows us to see. Disrupted blood flow to the occipital lobe causes us to see stars!
Why do we see stars when we stand up too fast?
A similar thing happens if you stand up too fast. Standing up too fast causes some blood to pool in your legs and lowers your blood pressure. It can take a moment for your heart rate to pick up and compensate for this. During this short moment though, your brain has lower amounts of blood and oxygen flowing to it. Exactly like getting hit on the head, you see stars due to the brain’s lack of oxygen.
Postural hypotension or Orthostatic hypotension is the medical term for severe drops in blood pressure when you stand up from sitting or laying down. This is extremely similar to the terms discussed above but is really only applicable to people who see a significant drop in blood pressure and take much longer to recover. This is generally caused by dehydration or lengthy bed rest. It’s extremely important to see a doctor if you get dizzy or lightheaded when you stand up after sitting or lying down. (Source: Mayo Clinic)