St Andrews has certainly been well led over at least the last couple of Principals - Dame Louise Richardson (who went on to lead Oxford) and Dame Sally Mapstone.
They have also used their 600th Anniversary (2011-2013) for a major fundraising and investment, and are now working on another major (multi-hundred million pound) investment project to build a business school and computing facility.
However, even back in the era you are talking about, (when St Andrews grade demands were quite a bit lower than they are now) the university was forward-thinking and ahead of many of its peers - e.g. the investment in a metropolitan fibre-optic network and 24 hour access to Macs and Sun workstations (and every student who wanted one having an email address) (in 1990).
Also back then, St Andrews drew an international student body, but has grown that aspect (arguably in common with the rest of the UK university sector, but probably more sustainably) - bringing additional money in - for example it now has quite a significant number of US students doing their full degree in Scotland (where back in the early to mid-90’s it was mostly JYA (Junior Year Abroad) students.
Another thing St Andrews does very well, is maintain a connection with its alumni, and (now) their parents, which both maintains the brand and also helps them
raise development funds.
St Andrews has built on its historic traditions (as the third oldest university in the UK) and invested in its infrastructure, academic excellence, student experience and scholarships - all to good effect. Clearly the increased name recognition that came from William and Kate going there did no harm - but I don’t think it was just down to them!