Looking at a business's past resiliency can be a great indicator of how resilient it will be in the future. On that note, discount-retail chain Dollar General (DG -0.83%), online marketplace eBay (EBAY -0.33%), and gas-station chain Casey's General Stores (CASY 2.75%) all demonstrate resilient patterns.

As we'll see, there's plenty to like with this trio, especially when trying to solidify your portfolio with proven winners. As the chart below shows, both Dollar General and Casey's outperformed the S&P 500 over the past five years. And while eBay hasn't outperformed, returns are still positive. And it has a lot of potential over the next five years as well.

EBAY Chart

EBAY data by YCharts.

Here's how these three resilient stocks can help solidify your portfolio.

1. Dollar General

With this first stock, I'm putting my money where my mouth is. After assessing how my portfolio was diversified, I decided that I needed a more resilient stock to complement some of my riskier holdings. And that's why I've recently purchased shares of Dollar General.

Consumer behaviors are often driven by convenience, and that's why I like Dollar General. After all, with over 19,000 stores, there's almost always one nearby. And in smaller towns across America, it might be one of the only shopping options available. Moreover, in more populated areas, Dollar General could just be a few minutes closer to home than a big-box competitor -- ideal when you need only an item or two.

Sales are steady for Dollar General, making this a good resilient stock. And indeed, same-store sales increase most years, even during recessions. The chart below illustrates the company's consistency since the start of this millennium (recessionary periods are shaded).

DG Revenue (TTM) Chart

DG revenue (TTM) data by YCharts. TTM = trailing 12 months.

The chart above does illustrate that it's common for earnings per share (EPS) to pull back during lean (or uncertain) times, and that's exactly what investors should expect right now. Management expects net sales to grow up to 5% this year compared to last year. But it also expects EPS to fall by up to 8%.

This projected EPS decline spooked the market, and the stock consequently dropped. But this provides long-term investors with an opportunity. Shares of Dollar General now trade at just 15.5 times earnings. For perspective, its all-time cheapest valuation was a price-to-earnings (P/E) valuation of 14.4.

In other words, it's almost never been cheaper to buy Dollar General stock. Admittedly, earnings will struggle in 2023. But sales are resilient, it will continue to show growth, and earnings will likely rebound as they have in the past, which will lead to future gains for the stock.

2. eBay

At the recent J.P. Morgan Global Technology, Media, and Communications Conference, eBay chief financial officer Steve Priest said, "When the discernible shoppers have less disposable income, they will look to eBay for value." This was in response to an observation from an analyst that eBay is a resilient business. And I agree: eBay has long been a marketplace for hard-to-find items at bargain prices.

eBay isn't a growth stock by any means; trailing-12-month revenue is marginally lower than it was five years ago. But the company is very profitable, and it's a free cash flow (FCF) machine. It generated $2.3 billion in FCF over the last four quarters. And in the first quarter of 2023, its FCF margin was 28%.

I'm optimistic that management is taking FCF and striking the right balance between investing in its business and rewarding shareholders. It recently spent money acquiring other companies to improve its capabilities; thanks to acquisitions, it now offers authenticity guarantees for certain items and guarantees that car parts will fit correctly. To me, those seem like sound upgrades for keeping eBay as a platform that users love.

But management also rewards shareholders by paying a dividend and by repurchasing shares. Indeed, in a little less than five years, its free cash per share doubled because it has repurchased almost half of its shares. Meanwhile, the dividend marches higher as well.

EBAY Average Diluted Shares Outstanding (Quarterly) Chart

EBAY average diluted shares outstanding (quarterly); data by YCharts.

Trading at just 12 times its FCF, eBay stock is at a cheaper valuation than usual. And if the company keeps repurchasing shares and growing FCF per share, then the downside for eBay stock is likely very limited here.

3. Casey's General Stores

Like Dollar General, Casey's is a bet on small-town America. The company operates gas stations across the Midwest, and roughly half of its 2,500 stations are in towns with populations below 5,000. For these communities, a Casey's General Store might be the most convenient (and/or only) store option.

Moreover, 66% of revenue during its fiscal 2023 (which ended in April) came from fuel sales -- a resilient spending category because people need gas.

So the majority of Casey's revenue is intrinsically resilient, and that's a good thing. The bad thing is that these resilient fuel sales are low margin with a gross profit margin of just 10.7% in fiscal 2023. However, while customers might come for the fuel, hopefully, they'll spend money in higher-margin categories like groceries and prepared foods once they're there.

Yes, Casey's General Stores sell hot food like pizza and carry a selection of grocery items. These sales help bring overall profit margins up. In fiscal 2023, the overall gross margin was 20.4% even though fuel sales only had a 10.7% margin. And these higher-margin products helped the company earn $447 million in net income in fiscal 2023 -- not bad for a company with a market capitalization of just $8 billion.

Casey's does pay a dividend, albeit a low-yield one. As of this writing, the dividend yield is only 0.8%. But what the stock lacks in yield, it makes up for in growth consistency. Management just increased its payout by 13%, which marks 24 consecutive years of paying and raising its dividend.

A portfolio needs consistent performers

The future for many companies and technologies is hard to predict. And in a portfolio, there is room for companies whose future is far from certain.

However, it's also good to balance more-speculative ideas with consistent performers. That's why I believe Dollar General, eBay, and Casey's can help solidify a portfolio. And considering I just purchased shares myself, it should be obvious I consider Dollar General stock the best buy of the three right now.