And yet they're so massive that them all doing layoffs at the same time despite that profitability has a huge impact on the labor market of the while industry.
If someone produces less effort than they cost, it's reasonable to fire them even if the organization as a whole is profitable. That's probably not what the FAANG companies did, but layoffs are not unjustifiable for profitable companies.