As real estate brokers say, the price depends mostly on 3 things: location, location and location. If you are on Manhattan you pay more for that land than far away in Brooklyn. Similarly with the Domain Name System - shorter domain like www.abc.com is more desirable than www.hdhfjenyrj.goobledygook. There is no scarcity of string combinations for domain names yet people fight for desirable ones by paying a lot of money. It's a form of congestion pricing around naturally formed monopoly in desirable locations or domains.
These big tech platforms create their own land online - virtual estate. Limited human attention creates the scarcity of valuable locations where advertisers would like to show their ads. So they compete for being shown on Manhattan of the web - Google's top of the search results and Facebook's feed. The platforms can charge them huge monopoly, real estate like, prices for it.