A customer pushes a cart of purchased items outside a Costco Wholesale Corp. store in Hackensack, New Jersey, U.S., on Wednesday, Sept. 11, 2013. The U.S. Census Bureau is scheduled to release business inventories data on Sept. 13. Photographer: Ron Antonelli/Bloomberg via Getty Images

Sam’s Club, the Walmart-owned purveyor of bulk toilet paper and ketchup, had a terrible last few months, the company announced Thursday. Meanwhile its competitor Costco is doing just fine.

Sales at Sam's Club stores open for a year or more fell 0.5 percent from a year ago in the just-ended fiscal first quarter, the company announced Thursday. The poor results come a few months after the chain laid off 2,300 workers.

Costco, in comparison, recently took home $457 million in profits, even as its quarterly results disappointed Wall Street expectations.

"The divergence from Costco is striking, because they're basically in the same business -- but apparently they're not in the same business," said Faye Landes, a senior research analyst at the Cowen Group, a financial services company. Sam's Club, said Landes, doesn't "seem to have it quite right."

Here are a few reasons why:

Sam's Club may be targeting a suffering consumer. Sam's Club CEO Rosalind Brewer noted in an earnings call that the chain suffered this past quarter from a decline in public assistance for poor customers. With the economic recovery tepid and the government safety net getting smaller, poor consumers are cutting back on their spending, even at the cheapest-of-the-cheap outlets like dollar stores and Walmart.

And Sam's Club is not a cheapest-of-the-cheap outlet. You need a membership to shop there, a privilege that comes with a $45 yearly membership fee. That's cheaper than Costco's $55 a year, but it's still an expense.

If it's true that Sam's Club is relying on customers who need food assistance, Landes said, then "it's not clear if they have the right merchandise for that consumer. The stores are relatively upscale compared to that of Walmart."

Costco, on the other hand, explicitly targets customers with more money, who haven't been hit quite as hard by the downturn.

Costco shoppers "are probably a little more resilient in times of economic uncertainty, and my sense is they are a little less price-sensitive," Sara Altukhaim, an analyst at Kantar Retail, told HuffPost in an email.

The map below from Morgan Stanley shows the states with the most Costcos.

You'll notice that the state where the chain has the most stores, California, is also the state with the most high-net-worth individuals, according to a recent report from the research group Wealth-X. That seems to be a pattern: States with more Costcos tend to be relatively wealthier states.

Sam's Club may be losing customers to the Internet, or even to its own big brother, Walmart.

Brick-and-mortar retailers everywhere are struggling to adjust to the rise of Amazon, but Sam's Club may be particularly vulnerable. Altukhaim noted that Sam's Club shoppers may be more predisposed to use Amazon than typical shoppers. That's because services like Amazon Prime operate on a similar model to club warehouses -- you pay a premium to get certain discounts and benefits.

Sam's Club is fighting its customers' urge to turn to Amazon with an online service called "My Subscriptions," which launched earlier this year and offers services similar to Amazon's.

"The competitive landscape is shifting," Brewer said at an analyst conference earlier this year, according to The Wall Street Journal. "It's spanning from Amazon Prime, an online membership community, to the traditional warehouse clubs."

The Internet isn't the only threat to Sam's Club, though. The chain has also been losing business to Walmart, which offers many of the same products at competitive prices.

Costco customers are incredibly loyal, thanks in part to the chain's commitment to signature offerings.

Given that about 75 percent of Costco's operating profit comes from membership fees alone, "literally every decision Costco makes comes down to what the member wants," Altukhaim wrote. And members are evidently happy: The warehouse chain has a renewal rate of nearly 90 percent.

Costco's Kirkland brand, which accounts for about 20 percent of the company's sales, according to Landes, is evidently one of the things customers want. In 2002, Costco started selling a line of Bumble Bee tuna under the Kirkland name that was of better quality than the original Bumble Bee, according to CNNMoney. By using the Kirkland brand to sell quality products at an affordable price, Costco has convinced consumers to trust Kirkland, and Costco by extension.

Costco probably also has better leverage than Sam's with its suppliers, in part because Costco can always sell its own version of a product if suppliers don't meet its demands, according to Landes.

"Costco uses their private label very artfully, while Sam's is not quite there," said Landes.

Nevertheless, Brewer said on the analyst call that Sam's is shifting its focus more to signature brands.

Costco also attracts and keeps customers with things like a commitment to low prices -- the retailer never marks anything up more than 15 percent -- and a relatively happy workforce.

Thanks to these tactics, the company known for its deluge of free samples and its $1.50 hot-dog-and-soda combo doesn't even have to advertise.