Shares of Taiwan Semiconductor Manufacturing (TSM -1.75%) have returned nearly 400% over the last 10 years, more than double the return of the S&P 500 index. That's even after a sharp sell-off last year over falling chip demand.

TSMC is a leading semiconductor company, but it operates as a foundry, meaning it makes chips for other companies. It has manufactured chips for Apple, AmazonAdvanced Micro Devices, Nvidia, and others. 

There's a lot impacting the consensus opinion of where TSMC stock goes from here, especially with mounting risks on the geopolitical scene and weak demand in the chip industry. Let's review three things about this superstar performer that smart investors know.

1. Taiwan's dominance in chips is a double-edged sword

One of the reasons investors love TSMC is the company's expertise in making the most advanced chips in the world. No one holds a candle to its capabilities. This is why TSMC generates a high profit margin of 42% -- well above the average 9% across all industries.   

There are five foundries that control at least 5% of the global foundry market. Two of the top five are based in Taiwan, and TSMC alone had a market share of 55% in 2022, according to IDC. The second largest is Samsung Foundry, with a market share of 16%.

However, Taiwan's dominance in semiconductors is a double-edged sword. U.S. export controls have limited China's access to advanced logic chips, and investors are concerned this raises the risk of a potential invasion of Taiwan by China, whose leaders view the island as Chinese territory.

Still, this outcome would hurt all stocks and the global economy, not just TSMC. In that context, TSMC appears undervalued. The stock trades at a price-to-earnings ratio of 14.4, which is at the low end of the stock's previous 20-year trading range. It's a bargain for a company that has a long history of double-digit revenue and earnings growth every year. 

TSM PE Ratio Chart

TSMC PE Ratio data by YCharts

2. The weak chip demand could linger into 2024

TSMC entered 2023 on a high note. Revenue grew 29% last year, but weak sales of smartphones, Internet of Things, and high-performance computing chips hit TSMC hard. In the second quarter, TSMC reported a revenue decline of 10%, with earnings per share down 23% year over year. 

Management noted that customers are still selling through excess chip supply, which is impacting demand for new chips from TSMC. While a surge in artificial inteligence (AI) chip demand is helping, it hasn't been enough to overcome the softness throughout the semiconductor industry.

TSM Revenue (Quarterly) Chart

TSM Revenue (Quarterly) data by YCharts

The bad news is that some retailers have reported softening consumer demand. If the economy were to sink into a recession, it could prolong the recovery in smartphones, which make up a third of TSMC's business.  

TSMC recently reported that revenue for September fell another 13.4% year over year, following a 13.5% drop in August. The stock has fallen 13.8% over the last three months. 

Again, this is another risk that appears to be priced in. TSMC shares were trading up about 1% the morning of the September sales report. Despite the slowdown in chip demand, TSMC stock is up 19% year to date.

TSM Chart

TSM data by YCharts

3. TSMC's long-term upside is worth the risks

TSMC faces near-term risks, but the stock could deliver excellent returns to investors. Management expects a steep production increase of its 3-nanometer chips in the fourth quarter, as it should be a big quarter for the iPhone 15 Pro, which uses TSMC's 3 nm processors. This production ramp-up will pressure near-term profits but will pay off over the long term. TSMC expects to deliver annualized revenue growth of between 15% and 20%, while rising margins should allow earnings to grow even faster.

The consensus Wall Street estimate has TSMC reaching earnings per share of $8.07 in 2025 with $100 billion in revenue. Applying an average P/E of 20 to future earnings prices the stock at $161, or a potential return of 83%.

Investors should keep the stock properly sized in their portfolio given the risks, but the upside is worth it. The world will always be inventing new products that require more computing power. That's a surefire opportunity that will fuel growing demand for TSMC's leading-edge chips and create market-beating returns for shareholders.