You only need to check the latest headlines to know the retail industry is suffering. Brick-and-mortar chains are closing hundreds of stores as e-commerce and other forces have brought about a sea change in the industry.

Retail stocks, especially those of department stores and apparel chains, have widely underperformed the market, missing out on the post-election rally as investors turn sour on the sector.

The exterior of a Wal-Mart supercenter

Image source: Wal-Mart.

However, there's been one notable exception: Wal-Mart Stores, Inc. (WMT 1.32%). Over the last three months, the world's biggest retailer has outperformed both the retail sector and the broad-market S&P 500.

WMT Chart

WMT data by YCharts.

Optimism seems to be building for Wal-Mart's strategy to take on Amazon.com (AMZN -1.64%) and grow sales, and analysts have taken notice. Since September, the stock has received four upgrades to buy ratings, and three other brokerages have initiated coverage at a buy, or its equivalent. 

The most recent upgrade came from Telsey Advisory Group, which lifted its rating on Wal-Mart from market perform to outperform. Analyst Joseph Feldman touted the retailer's return to "dominance" in physical retail and "new prowess" in e-commerce. He also raised his price target from $73 to $82.

Let's take a look at a few of the reasons why analysts have turned bullish on the once-maligned retailer.

Being proactive on e-commerce

Under the direction of Marc Lore, who came to Wal-Mart with its acquisition of Jet.com last year, Wal-Mart has been moving quickly to catch up to Amazon.

Lore has guided three acquisitions of online retailers in recent months, including ShoeBuy, Moosejaw, and ModCloth, and Wal-Mart is currently in advanced talks to buy men's fashion site Bonobos. Those moves should help Wal-Mart reach a new customer demographic, and its economies of scale should help boost distribution and lower costs.

Lore has also been making efforts to improve Wal-Mart's own e-commerce platform. In January, the company announced that it would offer free two-day shipping on orders of $35 or more for millions of items, a move that approaches Amazon Prime's free two-day shipping without a minimum order. Amazon also responded by lowering its free-shipping minimum for non-Prime members to $35 from $50.

Earlier this month, Wal-Mart made a move that Amazon will have more trouble copying, saying it will offer discounts on online-only items if customers come pick them up stores. The offer leverages Wal-Mart's massive store footprint, and it could be an important differentiator on some online sales since many Americans already visit a Wal-Mart regularly to do their grocery shopping.

Lowering prices

For years, Wal-Mart has positioned itself on its promise of everyday low prices with slogans like "Save money. Live better." But in recent years, the company has lost some of that price leadership. Costco Wholesale, for example, sells bulk goods nearly at cost, and Amazon and dollar-store chains have consistently picked off market share from Wal-Mart in part from their perception of lower prices.

More recently, though, Wal-Mart has been aggressively lowering prices to win back market share. The company has been pressuring its suppliers to lower prices, and it launched price tests at 1,200 stores across the country in order to win back share from dollar-store chains and newer low-price competitors like Aldi. 

Those efforts and others have yielded results as Wal-Mart's comparable sales, which have increased nine quarters in a row, have outperformed rivals including department stores, mass merchandisers like Target, and other grocery chains like Kroger.

Under CEO Doug McMillon, the company has shown it is willing to sacrifice profits in order to boost sales and market share as the company has made several such investments, including raising its minimum wage to $10/hour, enhancing its training program, making efforts to clean up stores, and expanding its grocery pickup kiosks.

The company understands that growth is more important than profits, especially as it needs to keep up with Amazon. As it makes more such investments to improve sales, Wall Street analysts should continue to take notice, and their approval should help send the stock higher.