Investors were treated to a rally in the first half of the year, with the S&P 500 surging higher by 16%. That's an unusually high jump for any period, but especially following the 16% increase that indexes logged in 2020.

The rally has generated much bigger gains for a few businesses that are capitalizing on major shifts in consumer spending patterns. CarMax (KMX -1.49%), RH (RH -3.37%), and eBay (EBAY 0.31%) stocks, in fact, have each more than doubled the 2021 return for the wider market so far this year. Let's look at why those rallies might just be getting started.

eBay's light operating model

There's no shortage of places investors can go to gain exposure to the e-commerce bonanza that the pandemic pushed into a higher gear. That list includes national retailers like Target, which are getting profitability lifts from their multi-channel selling platforms.

Credit card sitting on a computer keyboard.

Image source: Getty Images.

eBay is a solid bet on the industry for different reasons. The marketplace doesn't maintain huge warehouses of its own inventory, choosing instead to simply connect sellers with buyers. That setup allows it to benefit from rising demand (volume was up 29% last quarter) while maintaining industry-thumping margins (operating income is routinely over 20% of sales).

TGT Operating Margin (TTM) Chart

TGT Operating Margin (TTM) data by YCharts

That profit figure might expand more over the next few years as eBay finds new ways to add value to its service, including through payment processing and advertising. And its performance through the pandemic, with its active buyer pool swelling to 185 million, gives it a great market share position heading into the post-pandemic period.

CarMax's pricing power

CarMax today is benefiting from some unusually positive trends in the used car industry. Consumer spending is surging thanks to pent-up demand, and that spike allowed unit sales to jump 31% this past quarter as compared to the record set two years earlier (before the pandemic struck). Prices are rising, too, thanks to low supply and rising prices for new cars.

These shifts imply a strong fiscal year ahead for CarMax, but investors have even better reasons to like this stock. The company recently launched the biggest national e-commerce platform for online car shopping to give it a valuable lead in this arena. Management sees plenty of room for new store openings, too, with 10 slated for fiscal 2022.

That strategy should deliver roughly 10% annual sales growth if you believe CEO Bill Nash and his team. And it should translate into robust returns for investors in 2021 and beyond.

RH takes luxury to the next level

Luxury home furnishings specialist RH is having a good year. Management credited "the strongest demand trends in our industry" when it reported a 78% sales spike in the fiscal first quarter. Premium furnishing products are showing no signs of slowing, either, with sales likely to jump at least 35% from a strong base a year ago.

Yet, the bigger story from RH is its surging profitability, which is causing Wall Street to rethink what is possible from a furniture seller. Its operating margin blew past 20% of sales recently, with help from higher prices and strong demand for RH's portfolio of exclusive brands.

Management believes they can keep margins above 20% even after the current industry boom times end. We'll have to wait to know for sure, but RH's strong performance heading into the pandemic was a good sign. In any case, investors hoping for exposure to the home furnishings niche might consider focusing on the high end of the industry by owning a piece of this attractive growth business.