Conventional wisdom is that foreign countries do not pay the tariffs; importers pay them, and then pass them on to consumers. Various estimates claim that 95-99% of Trump’s tariffs are paid by consumers.
So now that the tariffs have been declared illegal, import companies are lining up to claim refunds on the tariffs they were forced to pay illegally. However, various websites are crying foul, saying, “Hey, it was really the consumers who paid those tariffs, so why pay refunds to the importers? In fact, the American taxpayer, who paid the higher price, is now asked to bail out the importers, who levied the higher prices on consumers in the first place. The taxpayers are being hit twice for the same price rise.”
But it’s a whole lot more complicated than that. The real losers are the foreign producers, because the tax on their products makes them lose sales. Too high a protective tariff may force the foreign producer to lose their entire US market. That could be a huge loss.
I live in Cambodia, where garment factories form a large part of the country’s GDP, mostly through sales to the US. I have seen garment factories forced to close, because Americans can no longer afford tariff-taxed Cambodian products. The garment industry in Cambodia has lost millions of dollars to Trump’s tariffs.
The winners are the American producers of competing products (just as Trump wanted). Consumers find American products more attractive than the (taxed) foreign imports. Not only do American sales rise, but the producers, without foreign competition, can now raise their prices.
What about tariffs on products that cannot be produced in the US, like coffee or bananas? If the price of coffee goes up, Americans will buy less coffee, or may switch to tea. At least they can switch to coffee from lower tariff countries, since Trump levied the tariffs unequally. The real losers are the high-tariff countries who must now sell less coffee.
Importers, who have simply passed the tariffs on to consumers, cannot claim injury from the federal government, so they should not be allowed to sue. Only the foreign producers should sue for damages. Of course, consumers, who have lost big time, will have trouble individually suing the federal government.
For those of you who like Econ 101 graphs, here is the situation:

Originally, the supply graph S meets the demand graph D in equilibrium point A. With the tariff applied, the supply graph moves up to S’. The new equilibrium point B shows a higher price than point A, but with a lower quantity of sales, Q2. It is that lower sales figure of Q2 that makes the producing country lose money.