What Causes Old People To Become Childish In Mentality?

When they get older , many older people become childish thinking. Thinking about very trivial things and act like little children about things. What is the cause of this? I know it is a form of seniality , but could sombody explain what is happening in their body or brain?
Also does this happen to people , say in their 30’s as well. Or maybe some people just never really “grow up”? Why do some people who should be married and having adult life, still behave as little children? Something similar to above?