Another factor I'll add to that is that the retailing is different for the two products. Diesel is largely sold to fleets. They get heavily discounted fleet pricing that you don't see. Joe the 3/4 ton pickup owner pays a stupid high price for his diesel, though. This is easier to see at truck stops, and it's why you often see a lower price at a smaller in town place, even though you'd think it should be the other way around based on volume.
OTOH gasoline is a consumer business. If your market has one or more aggressive marketers, your prices will be about as low as is practical. But more and more, those marketers are being bought out, by companies who are more into financial engineering than long term business development. They are price raisers, not price cutters. I watch markets transition to these bigger companies, and prices are high there.
In the old days, these fat hogs would get slaughtered by the price cutters. Any more, I don't see it happening. The price of entry is so big, nobody wants to spend millions on a gas station and then cut prices. And then there is the EV thing coming.