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.
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 :)
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.
a physical button on the floor under the gas pedal
I had an E30 BMW with one of those. Push the button and the automatic transmission would immediately downshift, and the engine would spin up in a hurry. Spaz mode was fun.