I grew up in a town with quite a few mental asylums, all closed now and turned into housing estates. However, in retrospect it makes me feel sad that, we, the young people of the town, knew so little about those who were incarcerated in such places when we were youngsters. Some were ex soldiers and the like, suffering from shell shock. I became aware of them as did my peers, whilst still at school in the '60s, so it's quite possible some of the men were veterans of the 1st World War and probably really suffered. They were harmless and were therefore often seen around the town.
A friend's mother was a psychiatric nurse, she told us that young girls not so long ago could be incarcerated for becoming pregnant outside marriage, probably at the behest of their family, because they were deemed wayward and unbalanced to allow that to happen so they would be in those places for years, for nothing really. That information resonated with me when I read a book called "The Disappearance of Esme Leonard" which was about such a young woman. An excellent and disturbing read.