In England the government provides ~£4 billion to fund universities via HEFE. About 1/3 of this is for teaching, 1/3 for research and a bit less for captial spending and other costs. There are different bodies for Scotland and Wales but I suspect they work similarly.
There is lots of info on the HEFE website about how the funding is allocated etc. I haven't looked too deeply, but the teaching funding is split almost evenly between supporting high cost subjects (e.g. physics/engineering) and supporting low access groups.
This funding is a small but significant % of university funding ~15% according to wikipedia.
In return the universities have to follow various regulations. The most significant of which is the tuition fee cap (~£9,000 currently) and do various things encourage encourage disadvantage groups to go to university.
Theoretically any university could refuse this funding and become private. However, I will speculate that the increase in tuition fees required to cover the loss would make them unattractive to students compared to public universities.