Power and fuel economy are not the only two variables. Emissions are the biggest thing that comes to mind: your new high-performance remap might put your car outside of the emissions limits for your market.
Some aggressive remaps can also adversely affect how the car drives in normal use. Think rough idle, or jerky acceleration. The vast majority of drivers do not want that.
Factory tuning is done the way it is for fuel compatibility, engine and component longevity, and a wide range of consistent performance at any reasonable altitude.
Changing the timing of the ignition, altered valve timing, and changing to a higher octane fuel can give you more power and better crusing economy at the cost of longevity, not being able to use a lower octane fuel, and possible issues if you drive at an altitude far different than the one it was tuned at.
Higher octane fuel shouldn't give you any more power; it just prevents pre-ignition. If your engine is very high compression and needs high octane fuels, then usually something like an anti-knock sensor is going to be present to cut engine performance--retard timing, I think?--if you have the wrong fuel in your car.
OTOH, a less energy-dense fuel like pure alcohol can increase power because you can increase compression in the engine even more than you could with high grade gasoline. That means that you can get more benefit from turbo- or super-charging.
IIRC, most fuel injected cars can now make some kind of adjustment to the fuel:air mix if you're at high altitude so that it shouldn't be an issue (unless you're at altitudes outside of their range of adjustment). Carbureted engines can not do that.
Longevity is almost always the price you pay for power though. The engine in my VW GTI could put out nearly double the horsepower that it currently gets, but the lifespan would be under half that of normal.
By sacrificing emissions.
You can get more power per stroke if you don't care about emissions, and that can get you a better fuel economy, but you may fail your local e-check if it's tuned.
Volkswagen got in trouble for designing their cars to change the engine tuning when it detected it was connected to a testing rig.
By remapping I assume you mean changing the ECU (engine control unit) programming.
Depending on what all it controls, usually fuel injectors and ignition, and what it reads, air pressure, rpm, oxygen, throttle input, the mapping adjusts timing of ignition, and how much fuel is injected based on how fast the engine is spinning, and where the throttle is set.
Most cars from the factory have a very simple mapping based around what most drivers do.
A fancy prototype CRX I had back in the 90s had very custom mapping that meant when I drove mellow, it got about 45 mpg, but had very slow acceleration. If I pushed the throttle past a certian point, it spun up like a bat out of hell, but the fuel economy would plummet.
What you can do with custom mapping is change the way the engine behaves under various conditions and based on the inputs. There is no magic get more out of the engine. Want more power? Eat more fuel and lose economy, and likely not burn off all the fuel so more dirty exhaust. Want more range? Limit power and lose acceleration.
I don't know anything about cars, is it possible to switch modes at the press of a button? If so, how instantaneous is the change? Like could i have it in fast acceleration mode when I'm gonna do a difficult highway on-ramp, and then switch to fuel economy mode once I'm at cruising speed?
Many cars have this with the touch screen, sport mode, eco mode, etc. Some will even learn from your driving behaviour and calibrate to that.
The change is functionally instant, and when the original post talked about mapping it's really a bunch of graphs and curves that dictate behaviour over the full range of rpm of the engine. You can switch maps on the fly by loading different basically spread sheets into the computer. Factory cars are calibrated for general use and epa standards, but you could make all kinds of special settings for various conditions.
My knowledge of this is dated, haven't been in the industry since 2000, but the basics haven't changed.
Older Porsches had a physical button on the floor under the gas pedal that you'd trigger when you floored it, putting it in spaz mode.
The truth is, how you drive has a bigger impact on fuel efficiency than anything else, don't accelerate aggressively, and stay below 65 mph. Wind drag above 50 mph is by far the greatest impact on fuel efficiency. Internal combustion engines are generally most efficient between 1800 and 2500 rpm, so if you keep your cruising speed there you'll get the longest range on road trips, but obviously it'll take that much longer.
My car sounds similar to your CRX. It uses either two cylinders, four cylinders or four cylinders and turbo depending on how hard I push the accelerator pedal. It's very cool :)
Higher cylinder temperatures will give you more power and better efficiency. It will also produce a lot more nitrous oxides. the engine won't last as long but that won't show up for many miles.
This is something I've played a little bit with in Forza Horizon, and after reading these comments, I think it would be cool if they added emissions as a metric in their engine simulations. Of course I'm sure that would also lead to folks rolling coal in-game.
Think of it this way:
if you modify and tune an engine to make more power the energy conversion is more efficient. A more energy efficient engine will be able to perform more work with less fuel.
So while it won't have better economy on a power run, it could have better economy while cruising.