Many investors were surprised to find a large position in Taiwan Semiconductor Manufacturing (TSM 1.11%) on Berkshire Hathaway's (BRK.A -0.73%) (BRK.B -0.70%) latest disclosure of its portfolio holdings.

The Warren Buffett-led company bought over 60 million shares of the chipmaker last quarter, making it Berkshire's 10th largest holding. Buffett has long eschewed tech companies, leaving that area to investment managers Ted Weschler and Todd Combs. But the size of the investment has led many to believe Buffett himself is responsible for building a stake in TSMC.

Regardless of who actually made the decision to buy shares for Berkshire, interested investors may be wondering if they should also build a position in the leading silicon chip foundry.

A stock made for Buffett

If you ignore the fact that Taiwan Semiconductor Manufacturing is a tech stock, it fits the bill of a Warren Buffett stock perfectly. It's an extremely profitable company with a strong competitive advantage, and its stock is trading at a very low valuation.

TSMC's gross profit margin is substantially higher than those of other stand-alone semiconductor foundries like GlobalFoundries or United Microelectronics. That's strong evidence of a competitive advantage and pricing power.

Indeed, TSMC has a big technology advantage over competing foundries. It's one of two companies, along with Samsung Electronics, capable of producing 5nm node chip designs. Smaller nodes allow the chipmaker to place more transistors on a silicon wafer, producing faster and more power-efficient chips. That's important to companies that make smartphones or graphics cards. As one of two foundries capable of producing designs using its leading-edge technology, TSMC can command higher prices for its chips.

TSMC also benefits from being the largest semiconductor foundry in the world. That scale gives it some cost advantages, but more importantly, it gives it the foundation to invest in its future. By pouring more money into research and development and building out capacity, it's positioning itself to sustain its technology lead for years to come.

And after shares fell more than 50% from the start of the year by the end of the third quarter, the valuation of the stock looked very appealing. Even after the bump the market gave shares after Berkshire's disclosure, they trade for a price-to-earnings ratio of just 13.5. That's right near the bottom of the stock's historical trading range.

Should you follow Buffett?

Shares of Taiwan Semiconductor Manufacturing appear undervalued, especially considering its strong position in the industry.

There are risks to consider, though. Specifically, the semiconductor industry is highly cyclical. We're just coming out of a supply shortage, which wreaked havoc across multiple industries. It spurred foundries, including TSMC, to build out capacity, which will result in higher fixed costs. That will drag down profits for investors when demand subsides and supply stabilizes.

The good news for investors is that TSMC is able to sustain production amid downturns better than the competition, thanks to its technology lead. What's more, it's been able to push through price hikes amid supply shortages. Investors can expect those trends to continue as it sustains its competitive advantages with its outsize investments in research and development.

That's not to say the stock won't be volatile as the company goes through these market cycles. The last two years are a testament to that. If you can withstand the cyclical nature of the stock, the shares could be a great fit for your portfolio.