Yes,, you are correct, it has something to do with it. You do get some fresh higher octane gas at some stations, but when the price is high and most people avoid the more costly gas, then you never know if the station you are buying the higher octane gas is fresh or not, could have been setting a long time.
Know your station, and what you are getting, that helps too.
BTW, if you EGR valve is not working correctly and or the timming is off your car will ping on regular gas, and if it is burning a little oil too.