Berkshire Hathaway (BRK-A, BRK-B) bought 42.1 million shares of Apple Inc. (AAPL​) in the last quarter of 2016. That stake is now worth over $5.7 billion, or over 1.3 percent of Berkshire's total assets under management.

The purchase represented a 276 percent increase in Berkshire's stake in Apple. Berkshire has already earned a profit of about $830 million on the new investment from the start of 2017; the company's total Apple stake has gone up over $1.1 billion over the same period. Berkshire shares are up 2.6 percent in year-to-date trading.

Historically, Warren Buffett has avoided tech stocks. Buffett famously avoided the dot-com bubble, which he said caused extreme overvaluations in tech companies that lacked staying power. After the bubble crashed, Buffett simply said, "I told you so."

Buffett's tech avoidance is in large part due to his position that many tech companies that do not turn a profit cannot create value. "Value is destroyed, not created, by any business that loses money over its lifetime," he once said about the dot-com bubble. However, in more recent times tech companies have become extremely profitable, and Apple has been profitable for a long time. The iPhone manufacturer earned $45.7 billion in net income on $215.6 billion in revenues in fiscal year 2016, earning a healthy post-tax profit margin of 21 percent.

That profitability may be why Berkshire loaded up on 15.2 million AAPL shares across several purchases in 2016. He first purchased 9.8 million shares as of Mar. 31 last year and then boosted the position by nearly 6 million shares by the end of June.

Warren Buffett did not buy or sell any shares in Berkshire's only other tech holding, International Business Machines Corp. (IBM), which has risen 9.5 percent year to date. Between its IBM and Apple holdings, Berkshire has earned over $2 billion in profits in less than two months from its tech investments.

Want to learn how to invest?

Get a free 10 week email series that will teach you how to start investing.

Delivered twice a week, straight to your inbox.