Walmart (NYSE:WMT) is raising wages again.

The retail giant said today that it would lift its minimum hourly rate to $11 for all U.S. employees, the third time in four years it's boosted starting pay. When it announced the first hike in 2015, going from the federal minimum of $7.25/hour to $9, investors responded by dumping the stock, pushing shares down 3.2%. Later that year, Walmart stock crashed after the company warned that wage hikes would take a bite out of profits.

However, this time around investors seem to have wisened up to the strategy of investing in the company's workforce. The stock was higher in pre-market trading and flat at the time of writing. 

In addition to raising pay, Walmart also said that it would expand maternity and parental leave benefits and provide a one-time cash bonus of up to $1,000 to staff. In total, the changes will benefit more than 1 million Walmart U.S. employees. 

CEO Doug McMillon explained, "We are early in the stages of assessing the opportunities tax reform creates for us to invest in our customers and associates and to further strengthen our business, all of which should benefit our shareholders." Walmart's move follows similar announcements from other blue-chip companies like AT&T and Wells Fargo, which paid out bonuses in celebration of the new tax law, but the bigger news here is how Walmart is using the windfall.

A Walmart employee stocks vegetables.

Image source: Walmart.

A new Walmart

Five years ago, the company would have spent the money on share buybacks and new stores, but today it's investing in its workforce. McMillon bucked longheld Walmart doctrine to do so, as the famously frugal company was known only a decade ago for things like encouraging its traveling employees to bring back pens and notepads from the hotels they stayed in so corporate could save a few bucks on pens. But McMillon's strategy has paid off.

Raising wages and improving benefits helped the company cut an egregiously high turnover rate. Employees were enticed by higher paychecks and a more direct opportunity for advancement. Wal-Mart's rock-bottom customer satisfaction scores started improving as the company cleaned up stores, cut down out-of-stocks, and sped up checkout lines.

As a result, customers have started coming back, and same-store sales began rising again, now up 13 quarters in a row. In its most recent quarter comparable sales increased by 2.7%, the fastest clip in nearly a decade. Higher wages are a key driver of that evolution.

And raising wages not only improves store operations and performance -- it also helps burnish the company's image. Ten years ago, Wal-Mart was pilloried by labor activists for pressuring wages down, busting unions, and refusing to offer medical benefits. Scandals involving bribery and gender discrimination also didn't help. But the Wal-Mart of today is considerably different. Not only has the company become a leader among retailers in raising pay, it's also one of the biggest consumers of renewable energy, and McMillon even spoke out against a "religious freedom" bill in the company's home state of Arkansas, which threatened to allow discrimination against the LGBT community.

McMillon understands that the company needs to grow its customer base beyond lower-income communities in the rural south, where it has historically been strongest. Walmart opened its first stores in Washington, DC just a few years ago, and though it still doesn't have any locations in New York City, it launched an advertising blitz there last year as its acquisition of New Jersey-based Jet.com gives it a foothold for online deliveries in New York. The company's improving image and McMillon's new approach may have also helped with its recent acquisitions of e-commerce brands like Jet, Bonobos, and Modcloth. That changing image will also help the company better compete with Amazon, which has traditionally been strongest with higher-income city dwellers, a key opportunity for Walmart.

It's worth it

This year's wage hike also comes as the labor market is tightening. Unemployment is down to just 4.1%, so it's important for Walmart to stay ahead of competitors. Target (NYSE:TGT) has already raised its minimum wage to $11/hour, and seems to be borrowing from Walmart's playbook in a number of ways, including its recent acquisition of Shipt.

The raises aren't free, of course. Walmart said they will cost $300 million in addition to what was included in this year's fiscal plan, and the bonuses will cost $400 million. Still, that's a relative bargain compared to the $2.7 billion the company spent to lift minimum pay to $9/hour in 2015 and then $10/hour in 2016. And don't forget that Walmart brings in nearly $500 billion in revenue a year, more than any other company in the world.

With the stock at all-time highs and a successful pivot to e-commerce and grocery pickup underway, Walmart is in the midst of a renaissance. Today's wage hike is one more reason to bet on the retailer's continuing success.

John Mackey, CEO of Whole Foods Market, an Amazon subsidiary, is a member of The Motley Fool's board of directors. Jeremy Bowman has no position in any of the stocks mentioned. The Motley Fool owns shares of and recommends Amazon. The Motley Fool has a disclosure policy.