How about a round of applause for Warren Buffett!

He’s in his 80’s but still evolving his investment process, and keeping an open mind to the fact that things change in this world. Unless you know a lot of older people, it’s hard to understand how monumental his latest moves have been.

This week, we learned that Warren Buffett’s Berkshire Hathaway has become the fifth largest investor in Apple after a nearly lifelong aversion to technology stocks.

We also learned that he’s upped his stakes in four airline stocks – American Airlines, Delta Airlines, Southwest Airlines and United Continental Holdings. He is the largest or the second largest holder of each of the four. This after publicly despising the airline business for decades upon decades.

For longtime Buffett watchers, these new investments are not so much of a shock as they might appear to more casual observers. Because what Buffett loves more than anything in the world is paying a fair price for a business with huge barriers to entry. In the parlance of stockpickers, we call these moats (as in the defensive ring of water that surrounded the medieval castles of yore). A good moat means sustainable profit margins and a defensible business model that allows for an investment holding period of (hopefully) forever.

An illustration of Buffett’s love for moats (and disinterest in companies without them) can also be seen in another bit of news we learned from the Berkshire 13F filing this week – he’s almost completely slashed his position in Wal-Mart. Wal-Mart is being disrupted mightily right now for the first time in its history. The story of WMT was always about how good its logistics and efficiencies were. This allowed them to beat everyone on price.

But Amazon is pulling this vaunted advantage down brick by brick, with investments in infrastructure, shipping technology and physical distribution on a massive scale. They’re building their own trucking fleets, warehouses, distribution centers and even their own fleet of UPS-like planes. Wal-Mart is no longer the cheapest or the most efficient retailer in the country – just the one with the biggest portfolio of legacy physical store assets. According to Fortune, Buffett is divesting accordingly:

The billionaire’s Berkshire Hathaway sold off about $900 million worth of Wal-Mart Stores stock in the last quarter, or about 90% of what he had left after years of paring his investment in the discount retailer. Buffett’s holdings in Walmart were worth $3 billion, and are now down to less than $100 million. The Oracle of Omaha first invested in the company in 2005.

Back to Apple and the airlines – has the Oracle lost his mind? Far from it, he’s doing what he’s always done, with the help of his new internal investment managers, Todd Combs and Ted Weschler. Todd and Ted have been inching their way into more oversight of Berkshire’s stock portfolio since they arrived on the scene earlier this decade. They’ve famously brought other moat-worthy ideas to the mix, with holdings like Visa and Mastercard, both of which have a stranglehold on the interchange fees that banks and vendors pay to verify creditworthiness each time you swipe your card.

Berkshire’s sixth largest holding is in another moat-y company, Phillips 66. It is the only energy stock they hold, but it is not a commodity bet – rather, it is a pure play on the relative scarcity of refining capacity. The position is now $7 billion, or 4.7% of their entire portfolio. They’ve been steadily adding to it since 2012 when it was spun off from Conoco.

Here’s 93-year-old Charlie Munger, Buffett’s consigliere at Berkshire, speaking a couple of days ago at the Daily Journal Corp annual meeting, over which he presides as Chairman:

“The nice thing about the game we’re in is that we can keep learning,” Munger said. “He’s changed when he’s buying airlines, and he’s changed when he’s buying Apple,” he said of Buffett. “I don’t think we’ve gone crazy,” Munger added. “I think we’re adapting.”

When looked at in this light, it is clear that, in the airline stocks, Buffett sees them for more than just the industries they play in. They are quasi-monopolies. The consolidation in the airlines has given these companies the type of profitability that’s eluded them since their inception. Management across the industry has become incredibly disciplined about bringing on less capacity and flying full planes. Up-charges and additional fees have also boosted returns for shareholders and these have become industry standard – we’ve gotten used to paying for bags and wifi and food and drink and everything else a la carte.

It’s fun to watch Buffett’s flexibility here, given his comments about the sector in the past. Here’s what he said in 1999, via Fortune’s Carol Loomis:

The other truly transforming business invention of the first quarter of the century, besides the car, was the airplane–another industry whose plainly brilliant future would have caused investors to salivate. So I went back to check out aircraft manufacturers and found that in the 1919-39 period, there were about 300 companies, only a handful still breathing today. Among the planes made then–we must have been the Silicon Valley of that age–were both the Nebraska and the Omaha, two aircraft that even the most loyal Nebraskan no longer relies upon. Move on to failures of airlines. Here’s a list of 129 airlines that in the past 20 years filed for bankruptcy. Continental was smart enough to make that list twice. As of 1992, in fact–though the picture would have improved since then–the money that had been made since the dawn of aviation by all of this country’s airline companies was zero. Absolutely zero. Sizing all this up, I like to think that if I’d been at Kitty Hawk in 1903 when Orville Wright took off, I would have been farsighted enough, and public-spirited enough–I owed this to future capitalists–to shoot him down. I mean, Karl Marx couldn’t have done as much damage to capitalists as Orville did.

He’s gone from “I wish I could kill Orville Wright” to becoming one of the largest holders of airline stocks in the world.

Berkshire’s purchase of a monumental amount of Apple stock is really the most interesting part of this. Berkshire’s stockpicking helpers bought their initial shares of Apple last year and then tripled their position from 15.2 million shares to 57.4 million shares in the fourth quarter! That’s a $7 billion position, or 1.1% of its market cap. They are now among the top ten holders of Apple in the world.

And as far as Apple’s competitive position – this one has a moat for the ages. Once you buy an iPhone (and humans around the world have bought over a billion of them so far), you become locked into the Apple ecosystem for almost all of your devices and services. Think cloud access, iTunes purchases, the App Store, etc.

Services is a great business, a fact that is becoming more apparent every quarter. Apple’s services business is growing at approximately 20% a year, to $24 billion in calendar 2016. To put that number into perspective, McDonald’s does $24 billion in revenue per year – Apple’s services biz is now the same size as the largest restaurant chain on earth.

And Apple users are kind of sort of compelled to stick with the ecosystem, unlike the fierce competition faced by McDonald’s every time even its most loyal customers drive by a Taco Bell or see a Burger King ad. It may have one of the most impressive moats in the history of technology, right up there with what Microsoft had in the 90’s and Google and Facebook are currently enjoying today. This is rare for a “consumer electronics” company, which is what Buffett has always been wary of.

Apple’s moat is a thing of beauty. Hell, take a look at it’s brand new headquarters building, soon to be completed – the whole f***ing thing is shaped like a moat!

I’ll wrap by saying that it’s really an amazing time to be watching this all unfold. Buffett and Munger coming into airlines and Apple now, after decades of avoiding anything that even looked like an airline or a tech business, is an affirmation that as the world changes, great investors rethink long-held opinions and biases.

I’ll let Buffett finish us up with one more quote from his highly skeptical take on technology stocks back at the height of the mania in 1999:

I won’t dwell on other glamorous businesses that dramatically changed our lives but concurrently failed to deliver rewards to U.S. investors: the manufacture of radios and televisions, for example. But I will draw a lesson from these businesses: The key to investing is not assessing how much an industry is going to affect society, or how much it will grow, but rather determining the competitive advantage of any given company and, above all, the durability of that advantage. The products or services that have wide, sustainable moats around them are the ones that deliver rewards to investors.

It’s different this time. Truly.