In Unix/Linux parlance, system executes a command in a child-process and waits for it to complete. Whereas exec replaces the current process with the one specified.
For instance, I have used exec in a so-called “trampoline script” to support a hoary old CGI program in a new environment. The trampoline first sets up the environment, then replaces itself with the original program. Having done its setup duties, the trampoline process disappears, but the original program is launched into the same, modified, environment. The original program cannot detect (and of course, does not care) that it was not initially launched by the web-server. A simple and effective “hack,” I think . . .