It's usually from a separate 'pot' of investments, for which separate fundraising is carried out (popular theme for alumni appeals). Schools can make contributions to the pot from general income, but they do have to keep a close eye on affordability of ordinary places.
Usually there are separate funds invested to generate bursary income , having initially been created through fundraising, donations and legacies which are topped up over subsequent years. Fee income pays for the running of the school , maintenance and capital projects.
Our local private school gives scholarships to most of the pupils. These are typically discounts on fees of up to 75% and are each named after the donor. "The Smith Scholarship" etc.
The school has a long history (100 years+) and many of the donors are past pupils who wanted their names remembered while passing on a benefit, but there are also quite a few where a child died and the school fees the parents were going to spend are instead used to to remember them through this gift.
My old school funded it similarly to how @AnotherNewt describes, I think. The school has a fund, puts money in and accepts donations, gets legacies, has appeals etc to top it up. They may not all be like that but I think that probably describes how some places do it. No idea for places such as Christs Hospital, though as so many places there are aided/fees adjusted.
My old school also has a particular charitable fund for subsidised places for children of the clergy which I think was originally funded by some sort of subscription and which is now funded by a specific pot. Partly because the scheme is historic, partly because not everyone who wishes to support subsidised schooling would choose to support this.