Here’s the funny thing about canned tuna: Even as Americans lost their taste for the fish and demand dropped steadily for years, the price of a can seemed to hold steady or rise.

For some, it was an economic riddle.

“Given what was happening to demand, the price of tuna should have declined,” said Andrew F. Smith, author of “American Tuna: The Rise and Fall of an Improbable Fish.”

It didn’t.

Now, there’s a new theory for the price of tuna. According to a lawsuit filed by one of the nation’s largest retailers, the price of tuna was held aloft because executives at the nation’s three largest tuna brands — Bumble Bee, Starkist and Chicken of the Sea — were colluding to fix prices.

Citing email, industry conferences and phone calls, attorneys for Walmart allege that the tuna brands set the price of tuna in order to defy economic forces that ordinarily would have pushed prices down.

Last week, in a related criminal case filed by the Justice Department, Bumble Bee Foods pleaded guilty to conspiring to fix prices sold in the United States between 2011 and 2013. The firm has agreed to pay a $25 million fine.

In addition, two Bumble Bee senior vice presidents, Ken Worsham and Walter Scott Cameron, pleaded guilty to fixing prices. They agreed to cooperate with federal authorities in the ongoing criminal investigation.

The Walmart lawsuit alleges a much broader and longer-lasting conspiracy among the three tuna brands. None of the three answered invitations to comment.

“We believe there is strong evidence that suppliers of canned tuna to Walmart conspired to artificially inflate and wrongfully fix prices in order to increase their own profits at the expense of consumers,” said Randy Hargrove, a spokesman for Walmart.

In Walmart’s view, laid out in court documents, the conspiracy among the three companies, which control about 80 percent of the U.S. market, began by 2010, at the latest, and lasted through July 2015. During that period, Walmart alleges it was overcharged by the tuna companies.

“Senior executives met at least twice annually and regularly discussed prices and shared sensitive customer information,” according to the Walmart lawsuit. Walmart also alleged that the tuna companies agreed to spurn aggressive sales tactics — that is, they weren’t going to compete too hard.

In the past, industry officials have described the steady or rising price of tuna as the result of scarce supply. And indeed, the wholesale price of the fish has fluctuated. But according to the May 2015 Food Outlook of the United Nations Food & Agriculture Organization tuna prices had dropped considerably in 2014: “tuna prices declined significantly due to excess supply, with frozen skipjack prices hitting a 6-year low.”

Yet, according to Walmart, “despite changes in supply and demand that should have led to lower prices, [Walmart] continued to pay higher prices for packaged tuna products.”

But the extent of the alleged collusion, according to Walmart, extended beyond price-fixing. According to the lawsuit, the tuna companies sought to resist pressure from environmental groups such as Greenpeace. Those groups were pushing to outlaw fishing methods that ensnare other animals besides the tuna, including endangered sea turtles and sharks.

“Executives from Bumble Bee, Chicken of the Sea, and StarKist were concerned that a switch to a more sustainable method of fishing would decrease supply and put pressure on their margins,” according to the lawsuit.

Citing emails, the Walmart attorneys said that the companies agreed in February 2012 not to sell tuna branded as “FAD-free” or free of the devices blamed for the excessive taking of sea creatures.

The lawsuit comes as the canned tuna industry continues to decline as an American staple. Some of its fall is blamed on Americans turning to fresh fish; some of it was fear of mercury in tuna; other seafoods have become more popular.

Whatever the cause, without tuna’s slide in popularity, the collusion and its discovery might never have happened.

The shrinking of tuna sales has led to a series of mergers, and it was one such merger that helped spur the interest of federal prosecutors. In December 2014, Thai Union, the owner of the Chicken of the Sea brand, announced it would acquire Bumble Bee for $1.5 billion. A year later, Thai Union suspended the proposal after announcing that federal investigators had begun an antitrust investigation into the industry.

The troubles in the industry also led the big brands to work together, creating a setting that Walmart attorneys suggest was ripe for collusion. In 2011, the three brands, as part of the Tuna Council, paid for an advertising campaign to revive American interest in canned tuna.

“Tuna the Wonderfish,” was the name of the campaign.

That didn’t work either.

In 1990, per capita consumption of canned tuna was 3.9 pounds and by 2011, it was 2.6 pounds. And despite the campaign, it kept declining. By 2013, the figure had dropped to 2.3 pounds.