(Bloomberg) -- Stock market predictions are hard to make and so it has proved in the first half of the year: Almost no one foresaw an artificial intelligence-fueled $5 trillion bounce in tech, nor a banking crisis.

Within those themes, chipmaker Nvidia Corp. became the poster child of the frenzy around AI, while Tesla Inc. went back to being an investor darling. A bunch of US regional lenders collapsed, while Credit Suisse Group AG was bought by Swiss rival UBS Group AG.

For equity investors, returns this year have been steady, after a brutal 2022. Japan has been the standout, with stocks there staging a world-beating rally.

Megacap technology firms such as Apple Inc. and Microsoft Corp. have almost single-handedly driven gains in the S&P 500 Index, boosted by a perception that their strong balance sheets and durable revenue streams offer a safe haven at a time when economies are on the verge of recession.

Some things haven’t changed much. High inflation and high interest rates are themes that have continued to dominate investor sentiment, while China remains in focus as the expected economic recovery after Covid-19 lockdowns is faltering.

Looking ahead, Barclays Private Bank’s chief market strategist Julien Lafargue expects stocks to trade in a narrow range over the next six months. “The impact of higher rates is going to be a slow burn issue,” he said in an interview, “It will eat away at profits over time.”

As a result, investors will need to look harder for the next winning bet, according to Lafargue, who points to energy and banks as being attractively valued.

Here’s a look at some of the themes of the first half:

AI Frenzy

The buzz around AI led investors to pour a record amount of money into the technology sector, adding nearly $5 trillion to the value of companies in the Nasdaq 100 Index. Nvidia, whose chips are used in AI applications, led the gains, almost tripling and boosting the company’s market value to more than $1 trillion.

Some think AI will drive efficiency and boost profit margins across swathes of sectors, while others view the tech rally as being driven by the fear of being replaced (FOBR) — if AI is going to take over the world, you may as well hedge it by owning robot stocks.

Tesla Doubles

After dropping a record 65% in 2022, Tesla has more than doubled in value this year, including a record 13-day winning streak through mid-June. That’s triggered some warning signs, with the relative strength index pushing deeper into overbought territory and recently hitting levels not seen since late 2021.

Alongside broader tech gains, the surge was fueled by positive newsflow that included General Motors Co. and Ford Motor Co. making moves to adapt their electric vehicles to Tesla’s Superchargers, and Model 3 sedans becoming eligible for the full US tax credit.

Tesla’s AI Dreams May Already Be Priced Into Stock: Tech Watch

Banking Crises

Banks encountered turmoil on both sides of the Atlantic. In Europe, jitters at Credit Suisse turned into full-blown panic, as clients yanked cash out of the former icon of Swiss finance. The firm was bought by UBS after the government hastily arranged a takeover.

And in the US, regional banks with combined assets of more than $500 billion collapsed. Two of them — Silvergate Capital and Signature Bank of New York — were hurt by their connections to cryptocurrencies. Silicon Valley Bank and First Republic Bank, meanwhile, were stung by investments that proved to be vulnerable to rapid central-bank rate hikes.

China Swings

China’s CSI 300 Index began the year with its best January since 2009, rising more than 7% amid optimism about Covid-19 restrictions coming to an end. Yet by May, the benchmark had erased all those gains as a weaker yuan and the financial fragility of some local property developers added to persistent worries over growth and geopolitics.

Investors hoping for significant economic stimulus from Beijing are getting impatient, and geopolitical tensions haven’t helped. Beijing banned purchases of US firm Micron Technology Inc.’s products on national security grounds, in turn spurring Republican efforts to sanction a Chinese semiconductor firm.

Japan’s Back

Japan roared back as the Topix index hit a 33-year high. The growing acceptance of inflation might be one factor driving the gains, along with signs of better corporate governance. The market is also still remarkably cheap, with a large numbers of companies trading below book value or with very high levels of net cash.

It’s no wonder then that Japanese shares are even getting Warren Buffett’s endorsement.

--With assistance from Subrat Patnaik and Michael Msika.

©2023 Bloomberg L.P.