This, Apple is not primarily an advertising company. I buy quality products from them that last, still using a 2013 iMac that has never had any issues. Even original AirPods work so well, I replace them as the battery degrades.
The ads that drive their ad revenue are product placement within their store, like Walmart charging for a higher place on a shelf, or featuring a product in a sign at the end of an aisle, or offering it for free at a tasting booth.
Walmart doesn't make meaningfully more money when you buy product A or B (not counting their store brand), both are on the shelf, so their motivations are different.