What happened

Shares of Alphabet (GOOGL -1.97%) (GOOG -1.96%) were moving higher Friday morning after the company said it would cut 12,000 jobs, or roughly 6% of its workforce, in order to streamline the business and increase its focus on artificial intelligence.

Investors reacted favorably to the news, sending the stock up by 4.7% as of 11:35 a.m. ET.

So what

After its tech peers MicrosoftMeta Platforms, and Amazon all announced layoffs in recent weeks, the news was expected from Alphabet. During 2022, its profits shrunk, its stock price fell by nearly half, and its headcount growth significantly outpaced its revenue growth. 

In a letter to Alphabet employees that was shared publicly, CEO Sundar Pichai acknowledged, like the other tech companies reducing staff, that the company simply hired too aggressively during the booming days of the pandemic.

"Over the past two years we've seen periods of dramatic growth," Pichai said. "To match and fuel that growth, we hired for a different economic reality than the one we face today."

With slowing growth in advertising, and losses continuing to expand in Google Cloud and its "other bets" units like its Waymo autonomous vehicle arm, the layoffs make sense.

Pichai also said the company would shift its focus to AI, which comes as Google Search faces a significant new threat from OpenAI's ChatGPT, which will reportedly be included in a new version of Microsoft's Bing search engine.

"We have a substantial opportunity in front of us with AI across our products and are prepared to approach it boldly and responsibly," added Pichai.

Now what

Investors are clearly hoping the layoffs will give the business and its bottom line a shot in the arm, and make the company more competitive over the long term. Alphabet has reaped enormous profits from its near monopoly in search, but the rise of ChatGPT could put that in jeopardy.

Pichai said that the company is about to launch entirely new experiences for users, developers, and businesses. If that's true, and if Alphabet can fend off the threat posed by OpenAI, the stock looks like a bargain here at a price-to-earnings ratio of just 19, cheaper than the S&P 500.