What is wrong when the car dies after you take off the jumper cables on a 2010 Kia Optima?
Test and replace the battery if faulty. Don't jump-start again!
I agree that the battery is either dead or there are earth connection problems.
However, what was not mentioned in the other answer is that the battery acts as a buffer for the car's electrical system. Is the battery is dead, or even if there are earth connection problems, you may have a charger that produces overvoltage spikes. With no or dead battery (or poorly earthed battery) to buffer these spikes, when disconnecting the jumper cables, the overvoltage spikes could damage the car's electrical systems. This would cost lots of $$$ to repair.
If you have any reason to believe the battery is dead (not just lacking charge), DON'T jump-start. Instead, "jump-charge". Connect the jumper cables and let the battery be charged with the engine off in the recipient car (the donor car could have the engine on to prevent discharging its battery). Disconnect the jumper cables, and only after disconnecting the jumper cables, try starting the engine.
If the battery is old, it may be dead.
If you start having intermittent starting problems, the battery may be dead.
If the battery has been flat for a long time, it may be dead (lead-acid batteries don't like extended deep discharge).
Only if you forgot the lights on for a day, would I try jump-starting. Or perhaps I could try jump-starting also if I had been driving very short trips recently in cold weather, so short that the battery is depleted per each trip.