Many corporations binged on labor during the pandemic. Now, facing economic uncertainty and AI threats, they are slimming down.