Just hypothesizing here:
Probably, at least partly, it’s hormones and stress and also a build up of life experiences.
Plus, adolescence is when certain behaviors become less acceptable, and if they persist, it’s easier to diagnose the problem.
I remember right before my dad retired they were designing a study regarding ADD medication. They were thinking that possibly some children don’t respond well to medication because the diagnosis is incorrect and maybe they are actually bipolar.
Maybe imaginary friends get realized to be actual hallucinations, because most children outgrow an imaginary friend. Possibly, the child always was hallucinating. Although, it seems that in many people it does start in adolescence.
I think so many things affect our brains and mental health. It’s so complex that I doubt there will ever be one single answer.