Taiwan Semiconductor Manufacturing (TSM -2.94%) is an incredible company and one of the most important businesses on the planet. The majority of the world's most advanced microchips for smartphones, PCs, and data centers are made by TSM. Thus, it came as only a slight surprise that Warren Buffett's Berkshire Hathaway (BRK.A 0.91%) (BRK.B 1.09%) broke with a longtime aversion to technology companies and bought a significant stake in TSM in the third quarter of 2022.

However, it took all of about three months for Buffett and his team to reverse course and promptly sell off most of that brand-new TSM investment. This was no quick and profitable trade, though. On the contrary, the buying took place during the third quarter of 2022, when the average TSM share price was higher than in the fourth quarter. There's a good chance Berkshire Hathaway logged a loss on the short-term flip in this top semiconductor stock.

Why in the world would Buffett do that? The answer to that question provides a lesson for all investors.

Buffett and Munger and Musk might agree on this one point

Let's be clear here: Regardless of Berkshire Hathaway's decision to sell off most of its investment, TSM is still a wonderful company. However, investors need to know the battle that lies ahead for the big chipmaker.

Remember Elon Musk's "moats are lame" comment back in 2018? It was controversial (at least in the investment community), but there is a lot of truth to this statement -- most especially in the technology world. A company has to maintain its moat by constantly playing offense. In practical terms, that means constantly pouring money into innovation (research and development) to sustain a lead over potential "invading armies."

Warren Buffett gets it. This is precisely why he and Munger tend to shy away from making tech investments. As my colleague Billy Duberstein recently noted here, Munger alluded to the semiconductor industry during the Daily Journal annual meeting. Specifically, when it comes to businesses that require the reinvestment of lots of profit to maintain a long-term advantage over competitors, Munger said he naturally "hates a business like that."

In other words, when it comes to technology businesses, "moats are lame." I firmly believe there aren't all that many "deep moat" investments out there in the tech industry.

Taiwan Semi's incredible monetary advantage might shrink

It probably isn't coincidental that the U.S. CHIPS Act was passed in Aug. 2022 -- during the quarter in which Berkshire was apparently buying TSM. The act provides government funding to bring chip manufacturing back to the U.S. and diversify supply chains away from Taiwan. Similar government-sponsored funding has also been passed or is in discussion to bolster domestic chipmaking in other countries, too.

The reason for this sudden interest in reshoring chip manufacturing has to do with supply chain weakness exposed by the pandemic and with threats from mainland China to take over Taiwan by force.

However, government help could weaken TSM's technological leadership. The company has incredibly deep pockets, but federal funding is exactly what competitor Intel needs to catch up to TSM. Building new high-end chipmaking facilities costs a lot of money (primarily capital expenditures on advanced chipmaking equipment), but Intel could possibly narrow the gap with some cash kicked in from various governments around the globe. Similarly, Samsung could gain some ground thanks to these large government-sponsored infusions of cash.

TSM Revenue (TTM) Chart

Data by YCharts.

With pressure on TSM to keep spending its profits on chipmaking innovation, it's little wonder Buffett and Munger quickly exited their semiconductor holding. They want businesses that will pay them back in cash. TSM cut its dividend a couple years ago, a topic colleague Jason Hall and I discussed recently. And the company might have difficulty cranking out a high level of dividend income to its shareholders in the future given the competitive landscape.

Course correction is OK

In short, this is likely a case of Buffett and his colleagues rethinking their original purchase. When new information came to light, the team at Berkshire Hathaway considered it with an open mind and then had the courage to sell and move on since the business no longer met its investment criteria.

Interestingly, Munger also said at the same Daily Journal investor event (on Feb. 15) that TSM could be "a good buy at these prices." TSM is up nearly 30% since the end of Q3 2022 through mid-February 2023, and it still might be a good value in Munger's assessment. But if he doesn't have conviction in the business itself (versus having conviction based on share-price action), the stock is still apparently a no-go.

Lessons for investors abound, and one primary lesson sticks out here: It's important to do homework before investing in a company and develop your own thesis for why you own it. And if you encounter data that challenges a thesis, have an open mind and be prepared to course correct if needed. Don't let stock prices and perceived "value" alone dictate how you structure your portfolio. Stocks represent ownership in a real-life business, and the success of that business is what will ultimately dictate the direction of the stock price.

Know what you own, and make sure you have conviction in it.