Costco Wholesale (NASDAQ:COST) operates with some of the slimmest margins in retail.

Historically, the company's gross margin is just around 13%, compared to competitors who tend to have gross margins of at least 20%. That's part of Costco's strategy, and the reason it spends almost nothing on decor or marketing, and uses its cost savings and "no-frills" business model to offer customers the lowest possible price. Most of its profits come from membership fees, allowing customers to shop for goods nearly at cost.

That also means it isn't necessarily focused on profit margin, because it wants to ensure that those efficiencies are returned to the customer through lower prices. Nonetheless, Costco's profits surged in its fiscal fourth quarter as reported earnings per share jumped 27% to $3.13 on a 12.5% increase in net sales to $52.3 billion. The warehouse retailer got a number of tailwinds from the pandemic as shoppers continued to flock to its stores, stocking up on goods during a time when people around the world are spending more time at home.

Beyond its status as an essential retailer, the gains in leverage from the sales boost, and a near doubling in e-commerce sales, there were some notable reasons for the profitability increase. Let's take a look at a few.

A parking lot outside of Costco

Image source: Costco.

1. A fresh food boom

Fresh foods has always been one of the company's higher-margin categories, but sales in the category spiked in the quarter. Shoppers turned to Costco to stock up as options for dining out became limited. CFO Richard Galanti said on the company's recent earnings call that fresh food was the biggest driver of the 70 basis point improvement in core gross margin. The company benefited from improved labor productivity and lower expense for products that were damaged or destroyed, as well as for spoilage.

Galanti underscored another advantage of Costco's fresh food business:

We don't have spoilage. We sell out, not literally, but almost literally to the piece on these end things and so you're not throwing stuff away. ... it's a great business from a gross margin dollar perspective, given the sales strength in it.

That shows how fine-tuned the fresh foods business is, as well as the advantage of selling in bulk due to the lower risk of spoilage. Additionally, same-day delivery of fresh foods with Instacart was also a hit in the quarter, and seemed to attract new members and drive spending per member. Commenting on same-day fresh food delivery, Galanti said, "Anecdotally, I can't tell you how many people have mentioned to me how they love it, and they may very well be shopping same-day fresh or same-day whatever from their local supermarket as well."

2. Prioritizing safety

Costco was one of the first big-box retailers to require that both employees and customers wear masks, starting on May 4. Though Costco offers e-commerce, it prefers customers to come into its stores, where they tend to spend more. The mandatory-mask policy was a sign that Costco was prioritizing employee and customer safety and doing what it could to keep the coronavirus from spreading in its stores. Additionally, the size of Costco's stores and its wide aisles also helped encourage visits to its warehouses over other stores that may be more tightly packed. Talking about the rebound in store traffic, Galanti added: "We believe they feel safe, given the safety protocols and the mask requirements, the sheer size of the building itself and the width of the aisles. So all those things have helped us in that regard."

Since in-store customers are more profitable than online ones, that rebound likely helped Costco's profit margin compared to some of its competitors.

At a time when many other retailers have ended their extra "hazard pay" for employees, Costco is maintaining a bonus of $2/hour for at least the first eight weeks of the quarter. This reinforces its status as one of the best-paying retailers in the industry, and helps keep its customer satisfaction high. In the quarter, the company spent $281 million on COVID-19 premium wages and sanitation expenses.

3. Gas is still an advantage

While spending on gasoline was down overall as the pandemic has meant fewer commutes and fewer miles traveled, discount gas is still an important feature for members, and one that also delivered better-than-expected margins.

Gasoline sales were lower at Costco than a year ago, both in volume and because of lower prices. But lower prices have helped the company generate greater profits from gasoline than conventional gas stations, which have not lowered their prices as much as the cost of the fuel. Galanti explained, "Prices have come down, [and] traditional retail has not been as competitive, which allows us to be more competitive but still make a little more."

He also noted that Costco's pre-pandemic gasoline sales back in February were growing at close to 10% volume on a comparable basis, compared to low-single digits in the rest of the industry, showing Costco's price discounts are bringing in more customers. Today, volume sales of gasoline are down only 10%, showing the company has regained nearly all of that business, and at higher margins than it had just a couple years ago.