In a major triumph of medicine, we now know that brain cells shrink during sleep (about 60% in rats), allowing cerebrospinal fluid to flow about 10 times as fast [1] [2], helping to cycle out built up toxins and waste products and eventually drain them into the bloodstream. It was previously a medical mystery how the brain was able to eliminate toxins without being connected to the lymphatic system (although it's since been shown that the brain is directly connected to the lymphatic system to some degree as well [2])
As far as I know, it's not proven that this contributes to the cognitive effects of chronic sleep deprivation. But it would make an awful lot of sense, and also help explain why sleep debt becomes more difficult to pay off the longer you let it sit around, and why the damage possibly even becomes permanent.
[1] https://www.newscientist.com/article/dn24429-sleep-boosts-br...