Domestic fees are capped (by the government) in some attempt to make going to university affordable for British people. The fees are already higher than just about anyone can afford, so students need to take loans to pay them. Despite this, the fees are below the cost of the course, and the price caps haven't kept up with inflation (which of course has been high lately).
There are no caps on fees to foreign students, so they've been something of a cash cow for universities for years. The relative number of foreign students you're allowed compares to domestic students is limited by the government.
However, of late they're not filling the foreign student quotas they're allowed. This could be for a number of reasons:
1) Brexit means it's harder for any students to come to the UK. Everyone needs to get visas and paperwork, which has likely become trickier for just about everyone. Europeans used to just be able to come here, but they now have all that paperwork to do as well. I guess if you have a hard-to-get-into-country and an easier one, then there's some value to go to the easier one.
2) Cost of living. The UK's always been pretty expensive, but that's only got worse in recent times. Just your average living expenses are now higher than they were, so as a student, you've got to carefully consider if you're going to be able to afford it. Given visa restrictions, "getting a job on the side" (as most brits now have to) is maybe not an option.
That last point also applies to domestic students. University is, for many people pretty unaffordable, and so they're turning to other choices such as apprenticeships and other vocational options. Some of those are really really good, and of course mean you earn money while you're learning, rather than charging you money to learn. Contrast to the government mantra some 20 odd years ago that "everyone should go to university" (which was ridiculous, by the way) - useless courses filled with students, all contributing to the costs of the university, but likely not costing much to run (and then likely not being of use in the workplace).
A lot of the cheaper-to-run courses are now less attended than they once were (see my last point). They likely subsidised the more expensive courses, which now isn't so much the case, and so departments are having to find ways to balance their books.
Lastly, research grants are harder to get, and perhaps not as lucrative as they once were. Aside from International competition, a lot of research is now done privately, where once almost none was done that way. Some universities have some utterly stupid terms and conditions on their research, which makes them less attractive to the private sector than alternatives, but that can't surely be true for all of them.
So all in all, there are lots of reasons why universities are in trouble. Truthfully, we've probably got too many universities and some consolidation is probably appropriate, but even still, it will have a dramatic effect on the future prospects of the nation if any of the good ones just aren't that great at the business side and end up closing down.