What happened

Shares of cosmetics company Ulta Beauty (ULTA -0.40%) gained 15% in June, according to data provided by S&P Global Market Intelligence. Investors seem to have realized that the 24% drop the previous month was an overreaction to a mixed earnings report.

So what

Ulta is the largest specialty beauty chain in the U.S. It has more than 1,300 physical stores as well as a robust online presence with 25,000 products from 600 brands. Its stores offer many beauty services as well, and the company brands itself as down-to-earth and relatable. This allows it to reach a large range of customers, from shoppers looking for better-priced products to those on the hunt for the latest high-end beauty trend.

The company was founded in 1990 and has built itself up to be the premier beauty retailer in the country. It has racked up a huge base of loyal customers: 95% of sales come from reward members. Aside from a dip at the beginning of the pandemic, Ulta consistently delivers robust sales growth and increasing profits.

The first quarter of 2023 was no different. Sales increased 12% over last year to $1.1 billion, with comparable-store sales up 9%. Net income increased almost 5% to $347.1 million.

However, there was pressure in other profitability metrics. Operating income moved up 1% to $442 million, but operating margin declined from 18.7% last year to 16.8% this year. Although management slightly raised its full-year revenue outlook after the report, it slightly lowered guidance for operating margin. That seems to have set investors off.

One other point of note is that earnings per share increased 9.2% from last year, almost double the increase in net income. Although there was a tax benefit in its favor, Ulta is a champion at share buybacks, which improve its per-share metrics and boost shareholder value.

Now what

Ulta is a long-term winner that connects with its customers and generates reliable sales growth. It's also highly profitable.

Even as its stock price has somewhat recovered from getting smashed in May, it's up less than 2% for the year. At this price, shares trade at a price-to-earnings ratio of less than 20, which looks like a compelling buying opportunity.