Yes, it does matter, because some brands contain more detergent additives that can prevent carbon deposits from forming inside your engine.
These are the so-called Top Tier brands that use considerably more detergent additives than is required by the EPA. Several vehicle manufacturers recommend using Top Tier gas so they and their dealers don’t receive complaints from owners about poor performance or fuel economy caused by carbon deposits, fouled fuel injectors or other issues.
Most major oil companies have adopted the voluntary Top Tier standards for detergent additives, including Shell, ExxonMobil, BP, Chevron, Phillips 66, Texaco and Valero, among others.
The vehicle manufacturers claim that using other brands of gas over time can allow carbon deposits to form in combustion chambers, which can cause engine knock or pinging (premature fuel ignition), and on intake valves, which can impede valve operation.
This doesn’t mean you should never use anything except Top Tier gas.