They do throw money at it. The problem is that fabs not only cost a fortune, but they also need several years to be build. TSMC is building a fab in Arizona for over $12 billion USD and I think Samsung is currently eyeing three different US locations for a new fab. The costs to build the new Samsung fab will be around $18 billion USD (there a nuclear power plants which are cheaper to build) and it will take three years to complete the fab. It's a lot of money and this chip shortage could be only temporary. Companies like Samsung and TSMC aren't going to invest such money if there is a risk that they won't get it back.
They do throw money at it. The problem is that fabs not only cost a fortune, but they also need several years to be build. TSMC is building a fab in Arizona for over $12 billion USD and I think Samsung is currently eyeing three different US locations for a new fab. The costs to build the new Samsung fab will be around $18 billion USD (there a nuclear power plants which are cheaper to build) and it will take three years to complete the fab. It's a lot of money and this chip shortage could be only temporary. Companies like Samsung and TSMC aren't going to invest such money if there is a risk that they won't get it back.