It's advanced machines doing most of it, and there is an operator handling each machine. The machines are extremely expensive, the building is extremely expensive, the ventilation/filtration/air control system is expensive etc.
These are not smartphone factories.
What is expensive is running these fabs/lines at half the capacity.