Intel cost are more expensive than foundry. Combination of several things make Intel totally incompetive.
First the size of factors makes for many tools running inefficient and others like scanners as totally constraints. TSMC and Samsung have huge fabs with economies of scale beyond Intel's wildest dreams.
Second when you scale tools up you dont scale engineers as much so they have huge efficiencies with regard to engineers and management of the fab.
Last the process at Intel from the PM and process to monitors is set up to maximize yield at any cost because they sell for hundreds and thousand versus 10 bucks.
Everything from process definition, to tool pm and monitor and headcount structure and scale would need to change for Intel to ever be competitive with TSMC or Samsung at a wafer level.
Just ask BK, Sohail, Ann, or Peter or any of the factory managers these questions and watch their eyes bulge and BS come out