There is a fair amount of research linking general health with the pace at which brain function declines with age: the less robust you are, the more likely you are to get dementia. We can look at the structural integrity and level of age-related decline in blood vessels in the brain as one possible mechanism to link such things as exercise and fitness to brain health, but there are undoubtedly others.
Here researchers look at links between lung health and brain function. Lung health, at least in the way it was measured in this study, may be a good marker for the sort of general robustness that both allows for and is improved by exercise:
Researchers used data from a Swedish study of aging that tracked participants' health measures for almost two decades. An analysis of the data with statistical models designed to show the patterns of change over time determined that reduced pulmonary function can lead to cognitive losses, but problems with cognition do not affect lung health.
The study sample consisted of 832 participants between ages 50 and 85 who were assessed in up to seven waves of testing across 19 years as part of the Swedish Adoption/Twin Study of Aging. ... Lung function was measured in two ways: forced expiratory volume, or how much air a person can push out of the lungs in one second, and forced vital capacity, the volume of air that is blown out after a deep inhalation.
"The logical conclusion from this is that anything you could do to maintain lung function should be of benefit to fluid cognitive performance as well. Maintaining an exercise routine and stopping smoking would be two primary methods. Nutritional factors and minimizing environmental exposure to pollutants also come into play."
Though this study does not explain what a loss of pulmonary function does to the brain, the researchers speculated that reduced lung health could lower the availability of oxygen in the blood that could in turn affect chemicals that transmit signals between brain cells.