Why does pneumonia cause dementia like symptoms in geriatric patients, but not in younger ones?

Aka delirium. Many acute illness may cause transient confusion & agitation i n the elderly especially post op also-most likely due to metabolic factors.