It's a game. If the word goes that out that crude oil prices will go up, station owners immediately jack up their pump prices. When they do, they make extra profit from gasoline that is already in their tanks - gas they paid less for. Then, when wholesale gas prices rise, the higher price lets them buy new gas to put in the tanks.
When oil prices go down, station owners don't immediately lower their prices at the pump. Instead they keep them higher until they buy fresh gasoline to fill the tanks at a lower price. Then, and only then, do they lower the pump price, but not down to the earlier level. Customers don't remember what the price was two or three weeks ago, so they keep it raised as long as they can before dropping it to maintain their usual small profit.
It's a complicated game, though. It's easy to make a mistake and get caught with expensive gas in your tanks, but lower prices on the pump, since customers expect the price to go down as soon as they hear that oil prices have gone down. The time lag between a wholesale buy by the refinery and that gas getting to the stations is longer than you'd think.
There are fewer gas stations than there used to be, and usually not across the street from each other. Customers usually have no idea what different stations' prices are. Loyalty programs, too, keep people going to their usual station. So, the price at the pump really doesn't follow crude oil prices that closely. It's just a game.
Finally, gas stations would all shut down if they relied on fuel sales. Not enough profit there. They all depend now on sales in the convenience store for all profits. The entire retail gasoline and diesel economy is much different than it used to be.