I think it would take a particular sort of person to want to go to university in St Andrews though.
It is not a big city with a lot to offer. It is a small place, a very touristy town, with few shops, nightclubs, etc for students to enjoy.
When I applied for University I dismissed it for this very reason and I am sure many, although not all, do the same.
It also has a reputation that would put many off. It attracts those who consider themselves to be or would like to be elitist. That does not mean that everyone who applies or who goes there is like that but it has that reputation nonetheless.
I went to Glasgow and felt that the people I met represented a broad cross section of society. Entrance seemed to have nothing at all to do with social background and everything to do with academic achievement.
Having taught secondary for years since, I have seen the same.
Maybe things have changed since I stopped working 8 years ago though.