As stores, chains, and even one-time retail giants have closed, it's been easy to blame that on a shift of sales to the internet. But sales shifts discussed as part of the so-called retail apocalypse have not impacted all brands equally. In fact, some traditional brick-and-mortar chains have thrived despite the existence of Amazon (AMZN -1.64%).

A changing market does not guarantee that older companies will fail. Sears, for example, thrived after business shifted from its catalog to its physical stores. It's still not going to survive the shift to the internet, but that's because it adapted poorly, not because it was doomed by Amazon's rise.

Retailers can continue to thrive, and many retail stocks remain good investments. What's clear, however, is that standing pat won't work. The formula is not exactly the same for every retailer -- for instance, Costco (COST 0.17%) has used a different formula than Walmart (WMT 1.32%) or Target (TGT -0.70%) -- but there are things to look for before buying shares in any retailer.

A Walmart pickup tower

Successful retailers have added ways for consumers to pick up orders. Image source: Walmart.

Look at logistics

Walmart and Target have to compete with Amazon, which offers free two-day delivery to its Prime members. Two days has become a standard, and it's now something consumers expect. Offering two-day delivery, however, isn't solely about cost -- it's also largely an execution problem.

These two large retailers had to go from logistics based on supplying stores to logistics that support delivering individual items to customers. Both have invested heavily in doing so, and while neither has perfected it, Target and Walmart have made themselves viable options that also offer in-store pickup, returns, and the ability to look before you buy.

Top retailers may never match Amazon's number of items offered for two-day delivery, but it's fair to say they offer enough to be competitive. Add that to their ability to offer omnichannel shopping (allowing consumers to purchase and return through any combo of at-home or in-store) and it's clear that Walmart and Target can compete, or even beat their digital rival.

Listen to customers

Walmart and Target saw that customers wanted convenience, and both looked for ways to deliver it. Those efforts have included curbside pickup, same-day delivery, and an easier in-store process for pickups and returns. Those companies aren't alone in hearing what their customers have to say. Best Buy (NYSE: BBY), which once looked like it would be a retail casualty, truly focused on fixing what its customers did not like.

One key area was pricing. The big box once fell victim to showrooming -- the practice of shopping in a Best Buy but buying on Amazon. To combat that, the brick-and-mortar retailer not only lowered prices, it offered price matching. It also offered free delivery on big-ticket items, since many customers can't fit a 60-inch television in their car.

Showrooming actually proved that consumers liked shopping at Best Buy. Their tendency not to complete purchases showed what they didn't like, and the company took smart steps.

Know and slow

Costco, as a membership-based business, has followed a different path. Even though many predicted it would fall victim to Amazon and its low prices, that never happened. That's not because the warehouse club made any major changes quickly; instead, it monitored its customer base, and slowly but steadily implemented meaningful change.

As a club that makes its money largely from selling memberships, Costco was able to watch its renewal rate for clues, which has hovered around 90%. A big drop might have forced faster change, but when that didn't happen the company was able to do things slowly, like ramp up its internet presence and add delivery options.

It's important to know that Costco never stood pat. But it took its time making changes that its customers clearly liked based on its continued success in growing same-store sales and retaining members.

Adapt or die

In most cases (with Costco as an exception) the retailers succeeding in today's market have been the ones willing to break from the past. Walmart, Target, and Best Buy pivoted to models that give their customers more choice. That keeps them from defaulting to Amazon just because it's easier.

All three of these brands have also invested heavily in behind-the-scenes technology to make sure that items can be delivered to individuals as well as stores. These are major changes, ones that retail failures like Sears, Sports Authority, HH Gregg, and many others failed to make.

Change, it's worth noting, has not stopped in the retail space, and it's not likely to over the next few years. Walmart, Target, Best Buy, and Costco have shown that they can evolve as the market does, or even make big pivots if that's required.

Check out the latest Walmart earnings call transcript.