Not an expert but I believe it’s essentially due to pressure causing the cone and rod cells to fire signals to the brain so you ‘see’ patterns and lights. Similarly, what you ‘see’ in the dark or with eyes closed is not true black but something like dim waves of patterns and lights specks or even something galaxy like – the neurons in the eye are still working, busy sending signals to the brain.
As for why rubbing eyes feels satisfying, perhaps it’s satisfying in the same way as scratching an itch is (light scratching mildly triggers pleasure are in brain).
Latest Answers