While Amazon's (AMZN 0.90%) competitors were busy catching up to its e-commerce capabilities, the online retail giant was building out its most profitable business ever: advertising.

But now that competitors like Walmart (WMT -1.23%) are showing growth in online sales, they've started going after the e-commerce goliath's new profit center. Walmart brought its advertising business in-house in 2019, but it's remained a tiny source of revenue and profits for the retailer compared to Amazon, which generated nearly $34 billion in ad revenue over the past year.

But two recent changes in Walmart's advertising business are resonating with advertisers, pushing more marketers to consider the Amazon rival.

Revamping advertising on Walmart.com

Walmart took some of the best practices from digital advertising giants and implemented them on its own website earlier this year.

First, it removed some requirements for advertising against search keywords while making sure ads that did surface were more relevant to the products consumers were searching for. It did so by making it less expensive to advertise products that organically surface for certain keywords. That move is designed to increase the chances that Walmart.com shoppers actually click on the ads they see.

The other major change is in how advertisers bid on inventory. Walmart adopted a second-price auction. In this auction, an advertiser bids the maximum amount they're willing to pay, but the winning bidder only pays the price of the second-highest bidder. The mechanism is common practice among big digital advertising companies. It enables advertisers to bid based on what they perceive the value of the ad placement to be, not the price they think others will value it.

These two changes make advertising on Walmart more valuable and more attractive to advertisers.

And the results speak for themselves

Walmart has seen strong results in the short time since implementing those changes.

Ad spend on Walmart increased 26.7% year over year last quarter, according to data from PacVue, Helium10, and Assembly. That compares to Amazon's 13.5% increase in Sponsored Product ads and just a 0.2% increase in its Sponsored Brands advertisements.

The changes in ad relevancy are clear as well. The click-through rate on Walmart's ads increased from 0.32% in the first quarter to 0.51% in the third quarter. At the same time, the click-through rate on Amazon's Sponsored Products advertisements declined from 0.37% to 0.31%. (Sponsored Brand ads improved click-through rates, though.)

What's more, Walmart's done a great job of attracting advertisers to its platform over the last couple of years. Total advertisers on its website increased sixfold compared to two years ago as of the end of Q2. With more advertisers and a more attractive bidding system, Walmart's poised for strong revenue growth in its ad business over the next few quarters.

Amazon will feel the pain

While Walmart is showing strong growth in its advertising business, Amazon's ad business isn't growing nearly as fast as it once was.

As marketers shift ad spend to Walmart, Amazon's been struggling to attract new ad dollars. In fact, if you remove the impact of Amazon's Prime Day in July, ad spending was close to flat year over year. A second Prime Day earlier this month could similarly bolster ad spend for Q4.

Walmart will continue to improve its advertising platform and attract new advertisers, cutting into Amazon's growth. But the pain could be more short-term for Amazon investors, avoiding a long-term race to the bottom with Walmart and other online retail competitors.

Improving returns on ad spend at Walmart will return to normal rates once the market fully digests the changes. That should happen by mid-year next year. What's more, the growth in retail media ad spend is expected to outpace the growth in the overall digital advertising market for years to come. That gives plenty of room for Amazon, Walmart, and lots of other retailers to grow their advertising businesses long-term.

In the short term, Walmart's changes could cut into Amazon's profits as even a small shortfall in the highly profitable advertising segment could have a meaningful impact on Amazon's overall razor-thin operating margin. But if everything else in the business looks healthy and as expected, operating profits that come up a bit short because of a slight underperformance in advertising could be a buying opportunity for Amazon investors.