What is the theory behind loss of intellect with increased age i.e., why do people; be it renowned scholars or ayatollah shows signs of loss of intellect while they grow very old?

This is normal thing with most if not all human beings.
Allah SWT says (ومن نعمره ننكسه في الخلق)