Alphabet's (GOOG 0.74%) (GOOGL 0.55%) powerful competitive positions in internet search and video streaming have made it a $1.3 trillion goliath in the global adverting industry. Yet even the mighty can fall, and formidable rivals are threatening to use artificial intelligence (AI) to disrupt Alphabet's most valuable business.

Against this backdrop, let's take a look at some reasons to buy Alphabet's shares today, as well as the key risks investors need to be aware of.

1. Digital ad sales are set to accelerate

Companies have pared back their marketing investments in recent months, due in part to recession fears and inflation's toll on consumers' discretionary spending. Alphabet's revenue rose only 1% in 2022, as these factors weighed on its advertising-related businesses.

However, the digital ad market will grow by nearly 50% to $910 billion by 2027, according to Statista, as more retail sales shift online. Search advertising is expected to remain the largest segment in this massive global market.

Annual search ad revenue  will top $400 billion by 2026, according to Statista.

Image source: Statista.

Alphabet's Google, as the dominant search engine with a 93% worldwide market share, according to Statcounter, is particularly well-positioned to profit from the search industry's expansion in the coming years.

Additionally, YouTube provides Alphabet's shareholders with another great way to benefit from the long-term growth of the digital ad market. With annual video ad sales forecast to grow to $230 billion by 2027, up from $160 billion in 2022, the video-sharing platform should remain a potent profit driver.

2. Cloud profits are on the way

Alphabet is also competing aggressively in the fast-growing cloud market. Google Cloud is the third-largest provider of cloud infrastructure services, behind only Amazon Web Services and Microsoft's Azure. But Google Cloud is expanding at a quicker pace, due in part to its highly regarded data analytics capabilities.

Investors appear to be discounting Google Cloud's growth because the division is not yet profitable. That's a mistake. Google has spent heavily to build out its global network of data centers and assemble a high-performing sales team. Now it's focused on scaling its cloud business, and improving its profit margins along the way. This is why Google Cloud CEO Thomas Kurian recently said "it's just a matter of time" before the business becomes profitable.

With the cloud computing market projected to exceed $1.5 trillion by 2030, according to Grand View Research, Google Cloud is poised to be Alphabet 's next major profit driver.

3. Alphabet's stock is cheap

Despite these intriguing long-term prospects, Alphabet's shares can be had for about 17 times its projected earnings in 2024. That's an attractive price for an exceptional business that's expected to grow its per-share profits by more than 16% annually over the next five years. 

The price is even more attractive when factoring in the roughly $99 billion in net cash and investments that Alphabet has on its fortress-like balance sheet. If we account for this cash, Alphabet's forward price-to-earnings (P/E) ratio falls below 16. That places its cash-adjusted price-to-earnings-to-growth (PEG) ratio at less than 1. Accordingly, the stock is in bargain territory.

This threat should not be overlooked

Still, no investment is without risks. For Alphabet, Microsoft is perhaps the biggest threat. Just days ago, The New York Times reported that Samsung is considering replacing Google with Microsoft's Bing as its default search engine on its popular smartphones.  The South Korean tech giant is reportedly intrigued by Microsoft's AI expertise. Losing its valuable default position on Samsung's devices would cost Alphabet several billion dollars in annual revenue, according to The Times

Businesses and investors alike have become enamored with Microsoft's AI offerings following its multibillion-dollar investment in ChatGPT-maker OpenAI in January. Microsoft is integrating OpenAI's technology into its products and services to gain market share and increase the value it provides to users. The software titan has targeted the search industry as a key growth market. 

That said, Alphabet is also investing aggressively in AI. It plans to add ChatGPT-like features to its search engine to fend off Microsoft and other rivals. Alphabet is also adding AI capabilities to its advertising solutions and productivity tools. 

CEO Sundar Pichai believes AI is more of an opportunity than a threat. During a recent interview with The Wall Street Journal, Pichai said the technology could help to expand Alphabet's total addressable market. "The opportunity space, if anything, is bigger than before," Pichai said.