Markets only "figure things out" in a petri dish economy where:
1) There are no barriers to entry for competitors (e.g. protectionist tariffs, equal access to capital for everyone)
2) There are perfect substitutes available, so transitioning to a competitor is seamless and free (e.g. no requirement to store data in Country X, no vendor lock-in, no security compliance)
3) The industry is not a "natural monopoly" when only a handful of vendors can operate due to capital investment and national/global distribution required (see power utilities, telecoms, petrochemicals)
4) Profitability attracts competitors (won't happen because of #3), but heavy competition prevents abnormal profits from accumulating to a single player (happens because of #1, #2 and #3)
When markets don't figure things out, as is the case around the world, you get a tangled mess of market failures, government intervention and lobbying to neuter proposed interventions.