It can be as similar to or as far from outsourcing as you allow it to be.
The "if AI code breaks, who will fix it? -> "AI will fix it" exchange has (anecdotally) been very common among executives, which is much closer to outsourcing than programming.
On the contrary. There are many benchmarks, some small subset of which are intended to reflect the whole market.
There are indices for every little thematic and niche corner or strategy or idea, there are broad-as-possible indices, and there are indices with requirements like listed age and profitability.
Maybe you know this already, but this reads like exactly the kind of reasoning that people looking back at irrational market euphorias point to as a sign things were about to go awry.
Index funds buy companies, for the most part, according to their market capitalisation.
They own more of bigger companies than small.
There's the option of "equal weight" or other strategies but the overwhelming majority is market cap weighted.
Index funds are also really, really big now and contain a lot of money earmarked for retirement/pensions.
In theory if you had a temporarily very frothy market into which you could sell a part of your unprofitable company to some people at a very high valuation, index funds would then mechanically move in and need to purchase and add significant support for insiders to sell into.
At one point (1.5 months ago) Bloomberg posted a piece saying the private market was apparently drying up for openai due to anthropic sucking all the oxygen out of the room.
The "if AI code breaks, who will fix it? -> "AI will fix it" exchange has (anecdotally) been very common among executives, which is much closer to outsourcing than programming.