It's kind of how the price of strawberries this week in the supermarket is determined by the supply of strawberries, demand from customers, and the price at neighboring supermarkets. It's not set by anything to do with the supermarket's profitability.
You see this dynamic in markets fairly frequently and the profitable goods and services will be promoted more heavily. One can get philosophical about what is supply and what is demand, but middle man profitablity is a factor in those things as they're at once a customer and a seller.
TLDR supermarket profitablity definitely drives pricing as well. Just another component.
> [supermarkets]
All supermarkets have to pay the same price to buy strawberries, regardless of their individual profitability.