They can do both things, and both things are described by Edgeworth Price Cycles[0].
In gas prices, there's undercutting to draw business -- which seems natural in a free market. That's often smaller, local players who drive this stage, pricing things just below the nearby competition, but players of all sizes are involved.
But sometimes, the price jumps up -- often by a significant margin, and across the board. This is often at the behest of a big player; when company like Exxon Mobil seemingly-arbitrarily raises gas prices in an area, it tends to set a trend. The smaller players tend to raise prices in accordance with this higher baseline and are happy to see the financial relief.
This may seem counterintuitive in a competitive market, but it does happen anyway. And it's all temporary and cyclical, as we've all seen over and over again. Free markets aren't necessarily stable systems that are free of resonance.
[0]: https://en.wikipedia.org/wiki/Edgeworth_price_cycle