By Charlotte Yang, Winnie Hsu and Abhishek Vishnoi South Korea spent much of this year as a poster child of the scorching global AI trade.

Now, by almost every measure, the $4.3 trillion stock market is rapidly losing relevance with investors.

Turnover has collapsed 70% from its peak in late May, foreigners are retreating at the fastest pace in Asia and local retail investors are also pulling back.

The Kospi, the world’s best-performing major equities benchmark in the first half, has since lost 22% to be the worst in the second half while its AI-heavy Taiwanese and US peers set new highs.

Behind the reversal is a market whose AI fortunes hinge disproportionately on Samsung Electronics Co.

and SK Hynix Inc., the two memory-chip giants at the heart of the global AI supply chain.

That concentration is now a liability as investors question the durability of memory chips’ boom cycle, while the brutal leverage-driven selloff in the summer has made some global funds hesitant to return.

“The biggest challenge I see for most investors — especially those who only recently got into Korea for the memory chip trade — is that the easy money in that theme has been made,” said Phillip Wool, head of portfolio management at Rayliant Global Advisors, adding his fund has been taking profit in Korean AI stocks and is now underweight SK Hynix and Samsung Electronics.

The two chipmakers together account for over half of Kospi’s weighting and powered its ascent earlier this year.

Foreign funds pulled $131 billion from Korean stocks this year, the most among major Asian markets, according to exchange data compiled by Bloomberg.

Skepticism over memory chip demand was on full display when shares of Samsung, the world’s top producer of such semiconductors, fell Thursday despite a nearly nine-fold surge in quarterly operating profit.

Korea is now struggling to lure buyers, a problem....