Many top names in consumer staples continue to outperform the S&P 500 this year, and top companies in consumer goods have often experienced soaring stock prices throughout the year despite increasing interest rates and predictions of potential reductions in consumer spending.

With that in mind, Coca-Cola Company (KO 0.07%) remains a top choice for investors looking for a stock that has, and is likely to continue to, soar over time. Likewise, Costco Wholesale (COST 1.15%) seems to have what it takes to not just beat the market, but to continue its place as a leader in its field at home in the U.S. and worldwide.

Here's a closer look at what makes each of these stocks promising choices for long-term investors.

1. Coca-Cola is beating the S&P 500

Coca-Cola Company continues to enjoy a slight edge in market capitalization over its biggest challenger, PepsiCo, and recent market conditions have often proved a boon to both companies. For example, Coca-Cola share prices regularly grew faster than the S&P 500 by gaps of 25 percentage points or more, increasing in value by 10% at times when the market dipped up to 15%. The soda giant's core business remains strong, and marketing initiatives, including the "What the Fanta" campaign drive new consumers to existing Coca-Cola brands.

The company's standing as a Dividend King entices many would-be investors with a solid history of ever-increasing dividend payouts, and Coca-Cola continues growing in markets where it has traditionally had little to no presence. This year's launch of Simply Spiked Lemonade and Fresca Mixed alcoholic beverages showcases a commitment to growth beyond traditional soda offerings. Net revenues grew 10% year over year, per Coca-Cola's third-quarter report, and earnings per share grew 14%. This points to the continued strength Coca-Cola has enjoyed during this bear market.

2. Costco memberships continue to grow in down markets

Costco Wholesale now operates 838 wholesale locations worldwide, giving it a giant reach that continues to expand over time. Like Coca-Cola, the company moved quickly to recover from the early trials of the global pandemic event. Share price growth regularly beat the S&P 500 by up to 15 percentage points through 2022 thus far. Average sales per warehouse continue to trend upwards, with newer properties bringing in $150 million and older warehouses exceeding even those totals as of the company's most recent annual report.

Continued growth in both foreign and domestic markets remains a hallmark of Costco's plan going forward. The company opened 26 new locations in 2022, up from 22 the previous year, and net income increased 17% in the same period. Costco also provides investors with a dividend, increasing the quarterly dividend payout from $0.79 to $0.90 per share earlier this year.

Key market challenges to these contenders

Inflation continues to challenge these two companies as it drives up the costs associated with product acquisition and distribution. Competitors such as Walmart may struggle to keep up with Costco's pricing, as the warehousing model enables sales growth with low gross margins close to 10% thanks to volume purchasing and reduced handling costs. Efficient distribution and the design of no-frills, self-service warehouse facilities also helps give it an advantage, as per the most recent annual report.

When it comes to challenges specific to Coca-Cola, the company has not yet publicly expressed or confirmed any interest in recreational cannabis-infused drinks, despite moves from Jones Soda and similar, smaller competitors. While this gives the competition a first-mover advantage, it appears likely that Coca-Cola considers the market too small for investment as of yet. There's little question that brand recognition alone would bolster sales and allow for a quick recovery of market share if and when such a move should occur.

Betting on the big boys for continued success

Coca-Cola has only one major competitor nipping at its heels, but PepsiCo remains within close proximity of taking over Coke's market capitalization and becoming the biggest of the soda giants. Costco continues to chase Walmart and similar competitors, but Costco's lower prices and membership model continue to serve as a foil for the retail giant and its Sam's Club wholesale chain. 

Continued growth in both foreign and domestic markets remains crucial for these two top consumer staples providers. Both of these companies seem well positioned to continue to dominate their spaces in the future, and both are stocks worth picking up despite strong performance in an otherwise challenging 2022 year.