"Look at current page content and display a relevant ad from inventory?" You could probably do that yourself on a Rasbperry Pi.
"Amass yottabytes of profile data across a galaxy of sites, run the sort of deep learning analysis you'd expect three-letter agencies to be applying to terrorist chatter, perform real-time auctions, fallback on retargeting..." You need a huge infrastructure for that. Only a Google or Facebook could possibly deliver such a competitive offering in that space. Sure, the ad ends up being the same a fair amount of the time, but dare you risk going with some Brand X ad network that can't do that?
It probably also helps to justify their price as middlemen. The ad revenue that doesn't end up in publisher wallets is going somewhere. Considering bandwidth and compute are cheaper than ever, they need to present some huge value add over being a dumb inventory exchange.