Meta Platforms (META 0.37%) stock has been rallying impressively of late, gaining more than 32% in the past three months amid the broader rally in technology stocks. As a result, Meta's market cap has jumped to $1.8 trillion as of this writing on July 14, making it the sixth-largest company in the world.

Meta is slated to release its second-quarter results after the market closes on July 31. The company has been able to grow at a faster pace than the digital ad market thanks to the integration of artificial intelligence (AI) tools into its offerings, which could enable it to deliver another solid set of results later this month.

Given that Meta stock is just 11% away from entering the $2 trillion market cap club as I write this, there is a good chance it could achieve that milestone in July, driven by the tech stock rally and a healthy quarterly report.

META Chart

META data by YCharts. E = earnings reports. 

Let's look at the reasons why Meta stock is primed for more upside this month and in the long run.

Meta Platforms can exceed expectations once again

It is worth noting that Meta's earnings have been better than consensus expectations in each of the last four quarters. One reason is the increase in spending across its family of applications by advertisers. In the first quarter, for instance, Meta reported an impressive increase of 10% year over year in the average price per ad.

Person smiling and looking at a smartphone in a gym.

Image source: Getty Images.

Ad impressions also increased by 5% from the year-ago period, which means the company is delivering more ads. This combination of higher pricing per ad and an increase in impressions delivered enabled Meta to report a 37% year-over-year increase in its earnings to $6.43 per share in Q1. However, investors should also note that the company has been aggressively increasing its capital expenditures (capex) to bolster its AI infrastructure.

It expects to spend $68 billion on capex in 2025, at the midpoint of its guidance range. That would be a massive increase over its 2024 capex of $39 billion. This explains why analysts are expecting Meta's earnings to increase at a slower year-over-year pace of 13% for the second quarter to $5.84 per share. While the increased investment in AI-focused data center infrastructure is undoubtedly likely to weigh on Meta's bottom line in the short run, the higher returns its AI investments are generating on the advertising front could help it beat the market's bottom-line expectations. And beating expectations often sends a stock up, as investors react with excitement and optimism.

Meta management points out that users are now spending more time on its applications thanks to AI-recommended content. In the six months that ended March 31, Meta saw the time spent on Facebook and Instagram increase by 7% and 6%, respectively. The increase in user engagement tells us why it has been able to serve more ads.

Moreover, the gains advertisers have seen on the dollars they are spending on Meta's applications are also quite solid. A couple of months ago, Meta said it "assessed the impact of [its] new AI-driven advertising tools and found that they drive a 22% improvement in return on ad spend for advertisers. This means that for every dollar U.S. advertisers spend with Meta, they see a $4.52 return when they use [its] new AI-driven advertising tools."

Unsurprisingly, Meta saw a 30% increase in the number of advertisers using its AI tools to create campaigns in the first quarter. So, there is indeed a solid possibility that Meta will clock healthy growth in ads delivered and the average price per ad in Q2, which could pave the way for a better-than-expected jump in its bottom line and help the company cross the $2 trillion milestone. I expect it to hit that market cap before Aug. 1.

The long-term picture is bright as well

Looking ahead, Meta expects that it will allow advertisers to completely automate the creation and execution of ad campaigns by the end of next year. As such, there is a good chance that Meta's earnings growth could accelerate from 2026, following this year's projected increase of 7%. Estimates are shown in the chart below.

META EPS Estimates for Current Fiscal Year Chart

META EPS Estimates for Current Fiscal Year data by YCharts. EPS = earnings per share.

However, there is a strong possibility that Meta's earnings growth will outpace market expectations, thanks to AI. That's why it won't be surprising to see its market cap jumping to higher levels in the long run, as the digital ad market is expected to clock a robust annual growth rate of 15% through 2030, and Meta has the ability to keep growing at a faster pace than the end market.