It's hard to know without exact figures. We don't know how much Amazon makes on indie book sales or an indie book advertising. But there is a connection between the two that Amazon will have to acknowledge sooner or later.
If Amazon ads moved book sales in a profitable way, we wouldn't care as much about other options. It's precisely because it's hard to make those ads profitable that we want other ways to boost our sales. But that would suggest we'd be selling more if Amazon hadn't strangled other paths to visibility. So Amazon may be gaining money in one way but losing money in another. Without exact figures, we can't know whether Amazon is making a net gain.
But a lot of people must have been spending quite a bit on Amazon ads even before Amazon tried to sabotage alternatives. So the real question is whether Amazon is getting enough of an increase in ad revenue to compensate for loss of royalties.
We don't know that answer, but here is what Amazon's overall revenue breakdown looked like in 2022 (in billions, from Four-Week MBA):
Online Sales: 220
Third-Party Resellers: 117.71
AWS: 80
Advertising: 37.74
Subscriptions: 35.22
Physical Stores: 18.96
Other: 4.25
https://fourweekmba.com/amazon-revenue-breakdown/Obviously, onlines and third-party resellers include a lot more than just indie books or even books in general, and advertising includes far more than just KDP advertising, but retails sales still dwarf advertising. So it might not be illogical to conclude that Amazon makes more on book sales than on book ads. Cutting sales to increase ad revenues might not therefore be the most brilliant strategy imaginable.
That's not to say that Amazon might not be doing exactly that, but it probably isn't the smartest business decision.
Oh, here's a little more specific data from
https://wordsrated.com/amazon-publishing-statistics/ I'm not sure how accurate the figures are because the source says only ebooks with ISBNs are included in some of the stats.
According to this article, books sales are 10% of Amazon's profit (at about 28 billion, which doesn't match the figures above). Amazon sells 300 million print books per year and 487 million ebooks per year. Indies make up about a third of the ebook sales. A comparable figure isn't give for print. When KDP opened, Amazon had only a little over 5% of self-published books (which is odd, but I guess that counts vanity press titles). Now it has 91.5% of indie books. It also has big chunks of the total book sales in the US and UK and is the largest single bookseller in the world.
Amazon likes these figures and worked hard to get into a dominant position. Doubtless, it would like to get more ad revenue as well. But is it really willing to become less dominant in sales to do that? Does it really want more indie authors to get discouraged and give up, or to get discouraged with Amazon and go wide? Losing indie authors costs both sale revenue and ad revenue. Having more authors go wide could spell the end of KU.
So yeah, Amazon makes money on ads. But it doesn't seem as if it makes enough money on book ads alone to compensate for potential revenue loss in book sales caused by trying to force people to buy more ads.