That’s kind of like saying “What’s the difference between an apple and other fruit that is not an apple.” It depends largely on what the aftermarket unit is designed to do. The idea is that the aftermarket ECU will let the car do things that it won’t do stock - for example change the operating parameters to emphasize power output over mileage. From the factory the car may be set up for a good balance between performance and fuel economy, but if you’re planning to get competitive with the car it’s better to emphasize performance and not worry so much about economy.
But you have to be careful because there’s a lot of snakeoil out there. Be especially skeptical of guys who claim their chip will improve both performance and fuel economy, because especially these days, they’re probably full of it - if doing that were possible at a reasonable cost, it’d have been done in the stock ECM.
Where aftermarket ECU/Ms come into their own is when you start modifying other things on the car. If you slap a bunch of parts on that increases air and fuel, and lowers exhaust restrictions, but the stock ECU isn’t capable of adjusting the engine parameters to take advantage of those things, then you’ve wasted your money unless you put a computer in there that can deal with them.
If you’re not modifying other things on your car, it’s almost always pointless to swap out ECUs.