In discussing competitive advantage, Warren Buffett once said, "You only see who's swimming naked when the tide goes out." What he meant by that is that companies with solid competitive advantages will really shine, or at least prove resilient, when circumstances go against them, either in a recession or during a period of industry or company-specific headwinds.

One retailer with underrated competitive advantages in my eyes is Ulta Beauty (NASDAQ:ULTA). Coming off a red-hot run the past few years, Ulta's stock hasn't found much love in the past 12 months -- it's down almost 20% though shares are up 10% year to date. The company hasn't done anything wrong, but the beauty category is simply cooling off after years of torrid growth. Also, the general U.S. retail scene is becoming challenged and more competitive. Once the third rail of high-end retail, department stores began doing the unthinkable last summer, discounting prestige makeup in a desperate attempt to reignite traffic that had been flocking to off-mall specialty retailers such as Ulta. A victim of its own success, Ulta's stock promptly fell off last summer.

Still, despite these challenges, the company managed to deliver some pretty great results, including its most-recent earnings report.

woman in white business suit smiling with arms crossed.

Ulta's resilient business model powers its impressive growth. Image source: Getty Images.

The quarter's headwinds

If you just glanced at Ulta's earnings without any context, you would have thought the business was going gangbusters. Net sales increased 17.4% on the back of 8.1% comparable store sales, with net income up an even stronger 28.2% and earnings per share up 31.7%. Of course, tax reform helped play a big part in the earnings per share number, but even without the tax law change, these were impressive results, and they came despite some prominent headwinds.

The primary headwind was weakness in Ulta's largest and most profitable category of prestige cosmetics. While some brands certainly thrived in the quarter, especially those to which Ulta had dedicated specially branded in-store kiosks (those being Lancome, Clinique, MAC, and Benefit), the prestige category lagged this quarter and certainly lagged behind the last few years' performance. "There was a lull in a few key brands within prestige cosmetics, which is a very significant category," said CEO Mary Dillon on the conference call with analysts.

Dillon, for her part, was also quick to make the point that the quarter showed the resilience of Ulta's model. Furthermore, despite the lull in this key category, other parts of Ulta's business, including mass cosmetics, skincare, and fragrances, along with its improved salon services, helped pick up the slack.

All things beauty, all in one place

As Foolish long-term investors, we advocate finding great companies and then holding them for the long term ... provided the company actually has a real competitive advantage. Ulta is clearly showing that it can achieve top-notch returns in a challenging environment, and that's a tribute to its winning business model.

Prior to Ulta, the beauty industry was separated between prestige and mass outlets, and cosmetics were often sold separately from salon services. Ulta's founders brilliantly created a winning model by bringing all of those segments of the industry under one roof, then dynamically curating its offerings according to Ulta's target customer, "the beauty enthusiast."

Bringing all the elements of the industry together had interesting results. One, customers that start in mass market can be upsold to prestige cosmetics over time. Two, those coming in for a salon treatment are much more likely to make "impulse" purchases in-store. Three, in the age of big data and artificial intelligence, Ulta's model works incredibly well as it can tailor its broad portfolio to where the customer is going while also mining its treasure trove of data from its Ultamate rewards program in order to offer customized discounts to its 28.6 million members. In the past quarter, Ultamate rewards' member count grew 17%, which should keep the good times going.

Winners tend to keep winning

Ulta faced headwinds in a key category last quarter, but this only showed investors the strength of the underlying business model. That's likely why the stock, after an initial post-earnings dip, quickly recovered back to pre-earnings levels. I'm a proud Ulta shareholder, and I intend to be one for some time to come.

Billy Duberstein owns shares of Ulta Beauty. His clients may own shares of some of the companies mentioned. The Motley Fool recommends Ulta Beauty. The Motley Fool has a disclosure policy.