A deserted shopping mall. Seph Lawless Amazon and Walmart are battling for shoppers at the highest and lowest ends of the income spectrum, leaving the middle class in the dust.

Amazon, whose Prime service claims more than 70% of upper-income households in the US — those earning more than $112,000 a year — is suddenly going after customers on government assistance who earn less than $15,444 a year for a one-person household.

The retailer on Tuesday announced it would slash the cost of its monthly Prime membership nearly in half, to $5.99 a month, for customers who have an electronic benefit transfer card, which is used for government assistance like the Supplemental Nutrition Assistance Program, better known as food stamps.

"It's a shot over the bow at Walmart," said Doug Stephens, a retail-industry consultant. In other words, the strategy is a direct grab for Walmart's core customers. Nearly $1 out of every $5 in SNAP benefits was spent at Walmart last year, according to Morningstar.

At the same time, Walmart is going after Amazon's core customers with its $3 billion acquisition earlier this year of Jet.com, which attracts a younger and higher-income group of shoppers than Walmart. The retailer has also recently been snatching up trendy online retailers like ModCloth, Moosejaw, and Shoebuy, and it's reportedly considering a bid for the high-end menswear brand Bonobos.

The two retailers' strategies of aiming at the furthest ends of the income spectrum highlight the widening gap between wealthy and poor Americans and the disappearance of what was once the most sought-after class of income-earners in the country.

"This is absolutely symptomatic of a deteriorating middle class, or at least what we used to consider to be the middle class in America," Stephens told Business Insider.

Less than 25% of households making less than $25,000 subscribe to Amazon Prime, while 60% of consumers making the same income regularly shop Walmart. Magid Retail Pulse

When Walmart was founded in 1962, the middle class in America was thriving.

"From postwar to about the late 1970s, you wanted to be in the mid-tier of retail. That is where everybody was making a fortune, including Walmart," Stephens said. "Then from 1980 onward, you wanted to pick a side, because it started to become clear that the middle class was evaporating."

The deterioration of union jobs, the shift of manufacturing jobs overseas, and the growth of the knowledge economy that led to a boom in high-skilled jobs contributed to this trend.

After the Great Recession, several other factors aggravated the problems facing mid-tier retailers.

Consumers started saving more money, and mall traffic plunged, along with spending on apparel and accessories.

People started shifting their spending from durable goods to experiences, travel, and restaurants. Consumers also started dealing with higher fixed expenses from increasing technology and healthcare costs.

As shoppers' spending habits changed, the middle class declined. Between 2000 and 2014, middle-class populations decreased in 203 of the 229 metropolitan areas reviewed in a Pew Research Center study.

That's why today, both high-end retailers and discount retailers are thriving — or at least surviving — while companies that relied heavily on middle-class spending, like Macy's, Sears, and JCPenney, are closing hundreds of stores.