It's a little complicated, but the basic idea is:
Information travels through neural pathways in the gray matter of the brain. Alzheimer's is caused by a buildup of plaques in the gray matter of brain. If these plaques block too many neural pathways, then information can't travel which results in symptoms of dementia.
Learning a foreign language won't stop this from happening, but learning a foreign language is so difficult that the brain is forced to create new neural pathways. If plaques are present when the language is being learned, the new neural pathways will naturally go around them. The result is that a language learner can have a brain ravaged by plaques, but be cognitively fine because all information is traveling through the new pathways.
If you want more info, look up "the nun study" and alzheimer's. It covers a lot of info, but the benefits of language learning are one of its findings.