This is interesting — stereotype embodiment theory:

… stereotype embodiment theory means that there's a stereotype of what aging is, which is a loss of physical and cognitive function. And if we expect that to happen, we stop engaging in the things that will prevent that from happening. And therefore, it becomes a self-fulfilling prophecy.

So, it's at least partly driven by what we expect and we expect less of ourselves as we get older. But there are dozens of studies using a wide range of interventions from physical activity to cognitive training to dietary changes that show that cognitive function can improve even in people's 60s and 70s as long as they start to engage in those processes.

Via 7 habits a neuroscientist swears by to keep your mind sharp at any age with Dr Tommy Wood.