More companies are freezing or cutting headcounts, often with AI help, to build their business with fewer workers.