I don't think it's that the fabs were shut down because of covid, but rather because automotive manufacturers (and presumably others) forecasted record low sales for 2020 and canceled all of their chip orders such that chip suppliers and upstream fabs had to lay off staff and so on. As I understand it, this was what reduced fab capacity, not "fabs were closing to avoid the risk of covid".
On the flip side, rather than demand decreasing as auto manufacturers expected, it actually spiked, and automotive manufacturers demanded more chips and were willing to pay $$$ for it. So other industries that use chips and accurately forecasted their demand were now bidding against automotive manufacturers for that fab capacity.