On the heels of last year's stock market rout, 2023 has been an animal of a different color. The S&P 500 has soared an impressive 27% from its bottom in October and now sits less than 5% from a new all-time high. This will mark the final criteria necessary to declare the onset of the next bull market.

Helping fuel this year's market ascent are the exciting possibilities born of artificial intelligence (AI). Some of the biggest gainers of the past year have been those with the most to gain from AI. Currently topping the list of the world's most valuable companies are Apple and Microsoft, with market caps of $3 trillion and $2.7 trillion, respectively. Both have inexorable ties to AI but are far from the only beneficiaries.

The one-two punch of a new bull market and AI will likely fuel the ascent of the next group of stocks to join the $2 trillion club. Here's my prediction regarding the next two companies destined to join this prestigious community and how they could achieve membership in 2024.

A person typing on a laptop with various AI icons displayed above.

Image source: Getty Images.

1. Alphabet

Alphabet (GOOG 0.80%) (GOOGL 0.83%) has a current market cap of $1.65 trillion, making it the most likely candidate to join the $2 trillion club in 2024. To surpass this benchmark, the stock would need to rise just 21% from Tuesday's closing price. Alphabet stock has increased by 20% annually, on average, over the past five years, even when accounting for the worst downturn in more than a decade, so it isn't too much of a stretch.

It's also worth pointing out that this won't be the first time Alphabet has joined this exclusive fraternity, having originally surpassed this benchmark in November 2021, just weeks before the onset of the bear market.

The biggest potential driver of Alphabet stock over the coming year isn't AI but digital advertising. Google is the global leader in digital advertising, controlling roughly 30% of the worldwide market, according to online marketing trade publication Digiday. The ongoing rebound in advertising will boost Alphabet's fortunes, as adtech is responsible for the lion's share of the company's revenue. Additionally, worldwide digital ad spending is expected to grow from $531 billion in 2022 to $1.5 trillion by 2030, growing 14% annually, according to research firm Research and Markets. A return to historical marketing spend alone could be enough to catapult Alphabet's market cap above $2 trillion.

Let's not forget AI, as Alphabet has been working feverishly to stake its claim, thanks to recent advancements in generative AI. The large language models (LLMs) that form the foundation for these next-generation algorithms can cost hundreds of millions of dollars to produce. Many experts suggest that well-heeled cloud infrastructure providers are in the best position to develop and provide these AI services to their customers, and Google Cloud is among the largest.

Finally, the trifecta of AI, cloud computing, and digital advertising should give Alphabet enough traction to regain its place in the $2 trillion club.

2. Amazon

Amazon (AMZN 2.19%) has a current market cap of $1.52 trillion, so it has more work to do to achieve its lofty $2 trillion objective. The stock would need to increase by roughly 32% from Tuesday's closing price to surpass this watermark. While this might seem like an ambitious call, Amazon stock has gained 75% so far this year and has grown at roughly 32% annually, on average, since inception, so my money's on Amazon.

It's important to put the past several years in context, as this has impacted Amazon's performance. Rampant inflation weighed on consumer spending as shoppers were forced to make tough calls in the grocery aisle and at the gas pumps, leaving precious little left of discretionary e-commerce spending.

Furthermore, businesses pulled back, not only on cloud spending but also online advertising, hitting two of Amazon's biggest growth drivers. This perfect storm punished the stock, which is still down 21% off its peak. However, the reverse is also true: when consumers and businesses loosen their purse strings in earnest, Amazon's e-commerce, cloud computing, and online advertising businesses will profit from the resulting windfall.

Also, similar to Alphabet, Amazon has been working feverishly to develop generative AI tools. It recently released Amazon Q, its AI-powered digital assistant, which can be customized for each cloud customer. Users can ask questions, and Q will scour its data to provide company-specific answers. Furthermore, Q works with any of the foundational AI models available on Amazon Web Services (AWS), making it more of an all-purpose assistant. While the tool was initially released for Amazon Connect -- the AWS contact centers service -- it will soon debut for other services.

The perfect storm that ravaged Amazon last year is abating. Businesses are beginning to resume historic spending patterns, and easing inflation gives consumers more discretionary spending. The strength of Amazon's core businesses is intact and will benefit from improving conditions. This will help put Amazon on the path to a $2 trillion market cap as soon as 2024.