To a great many people, the various grades of gas available at the pump represent little more than price points - a scheme to induce higher spending. Whether they buy regular or premium just depends on how they feel about spending money on gas (or perhaps how much they like their new bike). The fact that "premium" gas isn't actually better doesn't seem to matter much. To understand what I'm talking about, we'll need to dive briefly into the world of the internal combustion engine (I promise not to get too geeky).
Engine Compression
Most engines work by spraying a mixture of gasoline and air into a cylinder in the engine. The piston then raises in the cylinder compressing this mixture. When the piston reaches its highpoint in the cylinder, the spark plug fires, igniting the mixture. As the gasoline burns, it rapidly expands forcing the piston back down. This forceful movement of the piston gives the engine its power. The piston returns to the top pushing out the exhaust, and the cycle repeats (insert slight variations for two stroke and rotary engines here).
Octane
Octane refers to the chemical makeup of a particular grade of gasoline (to be specific, octane means a hydrocarbon chain with eight attached carbons - as opposed to heptane with seven carbons, etc). Years ago, scientists discovered that the number of carbon atoms in the chain altered the amount of pressure they could put on the molecule before it spontaneously combusted (burned without needing a spark). The octane rating displayed at the pump refers to a particular blend of gasoline (or equivalent in cases where other additives such as ethanol are included). For example, 87 octane means that blend contains 87% octane (87% of the hydrocarbons in the fuel are of the octane, or 8 carbon, variety). Your bike was engineered to work with a specific octane blend. The engine will pressurize (compress) the fuel to a point just below where that fuel will spontaneously combust, then use a spark to reliably trigger the burn process.
The Octane Myth
And it's here that the octane myth got its start. You see, if your engine is designed to burn 91 grade fuel, and you chose to run only 87, the compression of the engine will ignite the mixture in the cylinder before the piston reaches the top of the stroke. This produces what is known as knock. Knock reduces gas mileage, horsepower, and in some cases, causes physical damage to the engine. However, the converse isn't true. If your engine is designed to burn 87 octane, running 91 instead adds nothing. Both 87 and 91 octane (and 93, and 94 and even the fancy 100 octane gas sold at some race shops) burn equally well at the ideal pressure point of 87 octane gas. In other words, there isn't anything inherently better about a higher octane rating. Higher octane fuel just happens to be better at resisting premature combustion, it doesn't burn any different once ignited.
Impressions v. Facts
Unfortunately, these facts don't mean a lot to the many people who swear by premium gas. I recently had a discussion with a friend on Facebook, we're talking about a person who works in the motorcycle industry, who is absolutely convinced that the high mileage they've achieved on their bike stems from their consistent use of premium grade fuel. In reality, fuel grade had nothing to do with it. I have another friend, also a biker, who swears that this one time they tried high-octane race fuel in their sport bike and it was so much faster than normal. It wasn't. I didn't need to be there, I don't even need to know what kind of bike it was. All I need to know is how gasoline actually works and I can say with absolute certainty that there is no chance a CBR600 went any faster than normal just because it was running race fuel.
High Gas Prices
With gas prices near historic highs as war, inflation, and rising wages press prices to wild levels, it's super tempting to buy the cheapest stuff. Many people I've chatted with reason that they'll just use 87 octane for a little while until prices drop and then go back to getting that sweet sweet race juice (94 octane or whatever) as soon as it's reasonable again. Gas prices are hard to swallow, I hate them too, but your engine didn't wake up today tuned differently and it doesn't care what gas cost, it just knows what it was designed to burn.
What about ECU mods or an FMF?
Changing the exhaust pipe on your bike has no impact on the octane blend you should be running. Remember, octane controls when gas will spontaneously and prematurely combust - it's not directly about power output. You can get more power from higher octane fuel IF you also change your timing to take advantage of it. Putting a slip on exhaust can on your bike has no impact on timing, so it's not gonna require any different octane.
An ECU could be a different story. On modern fuel injected bikes, the computer does control timing to some extent (timing is managed both by the physical cam/piston settings of the engine and the ignition controlled by the ECU). Some fuel maps, like a couple from Taco Moto for the GET ECU will indeed adjust settings slightly to accommodate lower octane fuel. These maps are designed for riders who find themselves in locals with limited access to high octane blends. Note, however, that running a map like this is the same as de-tuning your engine. You will get less power from it because you are effectively reducing engine compression at the time of firing.
My bike has a knock sensor...
Some engines, like most modern passenger cars, have something called a knock sensor that detects premature firing and tells the computer to adjust timing to accommodate lower octane fuel automatically. This is one of the reasons most people can run 87, 89, 91, or a race fuel in their Ford or Honda and not really notice any difference. Some bikes have this too. It doesn't change the fact that running lower octane fuel is still giving up power. You may not need that power, in which case go for it, but please understand what is happening in the engine when you do.
I heard E85 is high octane?
Most gas sold at the pump in the United States has a small amount of ethanol mixed in. Ethanol is primary made from corn and found it's way into the pump because politics. It's one of the many optional "biofuels" and the sales pitch is that it's more sustainable (it's not actually). At one point, GM and Ford hopped on the "alternative fuels" bandwagon and started marketing their FlexFuel vehicles, cars made to run both E85 and regular gas. Some combinations of ethanol do indeed raise the octane of gas if you blend them right (that's a whole other article). Don't put these in your bike unless you know what you're doing.
I do not know of any motorcycle, certainly no dirt bike, that is designed for E85 and running it in engines not made for it will cause issues (it gums up for one thing).