Oh, it's really simple: the majority of the stock market is owned by rich people. Moreover, the top 10 companies in the S&P 500 are worth about 40% of the index? So when Nvidia, Microsoft, Meta, Amazon, Apple, Alphabet and a few others go up, the whole index goes up. Who's Nvidia selling GPUs to? All the other companies at the top of the index. The AI hype is pumping billions into the top end of the market.
It's worth remembering that the stock market is not the economy, and certainly the S&P 500 is not the economy, and the top 10 companies of the S&P 500 are not the economy. So inflation and joblessness are rising because they're the ACTUAL economy and nobody has any fucking money.
The fundamentals aren't really in line with any of this. The price-to-earnings ratio of these companies is insanely high, even accounting for how much money they're making. And people all over the world see Nvidia is doing well, so they dump money into the stock. And then people see the stock is going up, so they dump more money into the stock! And that's actually gone very well, but who knows how long it'll last.
tl;dr the stock market is a weird collective fever dream that doesn't necessarily (and never has) reflect reality.