This might be anecdotal experience, and I am not currently in a PhD programme so I am not sure it would aplly there as well, however this is what I have noticed:
In my country universities are usually an environment quite similar to High School wrt how students usually fit into the greater social circle of the institution, meaning that you usually go in for your lectures and leave as soon as you're done, have only a few ties with other students and there are almost no extra curricular activites to partake in through which you could bond with other people. During my undergraduate studies I spent a year in a university in the UK and this experience opened my eyes to how detrimental this environment is to students' performance; The university I attended explicitely encouraged students to set up "Student Associations" centered around whatever topic the person setting up particularly cared about, and in my experience I attendend events from many different ones, ranging from my department's one to anime/manga, to gaming, to my native country's culture. This has helped me so much in connecting with other people I would've otherwise never met who shared some of my interests, and in turn I was always able to have someone to speak to about common problems that students face, or to attend social events in order to decompress from a particularly hard day; at the end of the year I gave some of the best exams of my career, I made friends I am still in contact with years after, I was able to land an internship through one of these societies' events, and generally enjoyed life and university MUCH more than I ever did in my country. After coming back home and moving on with my life I am currently pursuing a Masters in my own country, and after a bit more than a semester I already feel the same feeling of dread I felt during my undergrad experience kick in since there are no avenues or ways to actually enjoy life as a university student.
I firmly believe that if more countries / universities adopted the same stance I experience in that UK university students would generally be way better off, both with respect to their mental health and their track record.
Unfortunately I have never met someone who has shared the same experience as me and hence has the same outlook on the problem, and even when speaking up about these issues with my department or colleagues many seem to not particularly care or understand what that particular system would entail for everyone involved. It is really a shame.
I am wondering if there are any scientific studies that have been done on this particular issue that I could bring up to shift perception around this?
Anyway, just my two cents.
tl;dr: make students more involved in their university's community and provide the means to self-organise around common interests so as to create comraderie and avenues to decompress, everyone will benefit from it.