The same way they do in every other bubble.
- the bubble pops, most companies fail. Mostly bankruptcies, massive layoffs but also huge tax writeoffs
- of the surviving companies, a couple strike the jackpot.
Most of that huge overall investment is lost, but everyone wants to be in on the one or two that succeed, and those specific investments could have huge returns