This TEDx video, Mark Mattson, Chief of the Laboratory of Neurosciences at the National Institute on Aging, explains why fasting is good for the brain…
This is because when you do intermittent fasting, you deplete the glycogen store in the liver (which takes about 10 to 12 hours to deplete) and you start burning fat for energy. If you eat three meals a day, it is hard to deplete this glycogen store. Although if you exercise, you may be able to deplete the glycogen store faster.
Burning fat for energy generates ketone bodies which the brain likes. Ketones provide an alternative fuel.
Fasting is also healthy for the body as well as the brain.
Some method of shifting metabolism via fasting, includes eating only 500 calories for a couple of days a week and eat normally for the rest of the week. Another method is to restrict eating to an eight hour window.
Fasting is actually a challenge to the brain. This challenge invokes adaptive responses by the brain that helps it cope with disease.
Vigorous exercise may have a similar effect. They both increase Neurotrophic factors (NTFs) in the brain (such as BDNFs). And hence increase the number of mitochondria in your nerve cells.
He also mentions that thinking challenges may also have a similar effect.
Evolutionary it also makes sense. If you are hungry, your brain works better in order to get you to find food.