It’s very unlikely that the deal says “we will buy everything you sell us no matter what.” It’s probably a typical purchasing agreement with tolerances and QA, just paid in advance.
Thus there is still a lot of risk being taken on by the fabs. The production could go sour, geopolitics could change, resources might be unavailable, etc.
The purchasing companies are externalizing all of this risk by purchasing the products instead of the company.
The chip companies probably have forms of insurance in place to cover losses if their independent supply chain partners fail to deliver that they wouldn't be able to get if the partners were integrated.
Thus there is still a lot of risk being taken on by the fabs. The production could go sour, geopolitics could change, resources might be unavailable, etc.
The purchasing companies are externalizing all of this risk by purchasing the products instead of the company.