I honestly don't think his problem is his mind. His mind is sharp, but his body is betraying him. When he slips up and can't find the next word, or mixes up some names, I think it's just his mouth outpacing his brain. When you give him time to finish his thought, he shows he still understands well.
Note that I'm not trying to minimize this. While I understand where his issues are, I still l think he's better off quitting and letting new blood take over.
Contrast this with Trump, who can't stay on topic even with a teleprompter. His insistence that Harris "started out Indian, then turned Black" can be explained by the idea that he can't tell the difference between Harris and Nikki Haley. I think Trump is much further gone than Biden is. Neither should be running