Silicon refinery and wafer production are highly specialized industrial divisions. Most fabs don't produce their own wafers, although some of the biggest players have their own subsidiaries.

* TSMC / WaferTech subsidiary https://en.wikipedia.org/wiki/TSMC#WaferTech_subsidiary

WaferTech, a subsidiary of TSMC, is a pure-play semiconductor foundry located in Camas, Washington, USA. It is the second largest pure-play foundry in the United States. The facility employs 1100 workers.[citation needed] The largest is GlobalFoundries Fab 8 in Malta, NY, which employes over 3,000 workers with over 278,709 m2 (3,000,000 sq ft) under rooftop.

WaferTech was established in June 1996 as a joint venture with TSMC, Altera, Analog Devices, and ISSI as key partners. The four companies along with minor individual investors invested US$1.2 billion into this venture, which was at the time the single largest startup investment in the state of Washington. The company started production in July 1998 in its 200 mm (8 in) semiconductor fabrication plant. Its first product was a 0.35 micrometer part for Altera.

TSMC bought out the joint venture partners in 2000 and acquired full control, and currently operates it as a fully owned subsidiary.

---

Even before you start making wafer, you need to have pure silicon, which requires a massive industrial refinery operation. See:

* Silicon Production https://en.wikipedia.org/wiki/Silicon#Production

Silicon of 96–99% purity is made by reducing quartzite or sand with highly pure coke. However, even greater purity is needed for semiconductor applications, and this is produced from the reduction of tetrachlorosilane (silicon tetrachloride) or trichlorosilane. The former is made by chlorinating scrap silicon and the latter is a byproduct of silicone production. These compounds are volatile and hence can be purified by repeated fractional distillation, followed by reduction to elemental silicon with very pure zinc metal as the reducing agent. The spongy pieces of silicon thus produced are melted and then grown to form cylindrical single crystals, before being purified by zone refining. Other routes use the thermal decomposition of silane or tetraiodosilane (SiI4). Another process used is the reduction of sodium hexafluorosilicate, a common waste product of the phosphate fertilizer industry, by metallic sodium: this is highly exothermic and hence requires no outside fuel source. Hyperfine silicon is made at a higher purity than almost every other material: transistor production requires impurity levels in silicon crystals less than 1 part per 1010, and in special cases impurity levels below 1 part per 1012 are needed and attained.

Then...

* Czochralski method https://en.wikipedia.org/wiki/Czochralski_method

High-purity, semiconductor-grade silicon (only a few parts per million of impurities) is melted in a crucible at 1,425 °C (2,597 °F; 1,698 K), usually made of quartz. Dopant impurity atoms such as boron or phosphorus can be added to the molten silicon in precise amounts to dope the silicon, thus changing it into p-type or n-type silicon, with different electronic properties. A precisely oriented rod-mounted seed crystal is dipped into the molten silicon. The seed crystal's rod is slowly pulled upwards and rotated simultaneously. By precisely controlling the temperature gradients, rate of pulling and speed of rotation, it is possible to extract a large, single-crystal, cylindrical ingot from the melt. Occurrence of unwanted instabilities in the melt can be avoided by investigating and visualizing the temperature and velocity fields during the crystal growth process. This process is normally performed in an inert atmosphere, such as argon, in an inert chamber, such as quartz.