I’ve tried looking it up, but all the explanations are a bit too layman for me, only explaining in broad terms what “CGI” is. I’m not a graphics expert, but I’ve done work in both Pixar’s RenderMan and GLSL, and I’m curious at how they superimpose things on live action film. A full 3D movie is fairly straightforward, since it’s just modelling any scene, adding King Kong or whatever seems more complex.
Neglecting Chroma Key work, my guess is that the bulk of the work goes into hand-defining depth, material, and surface normal information at each pixel of the input frame from the camera, as well as the source and color of various light sources. Then they can use displacement shaders to perturb the frame “as if” it were a 3D scene, and do shadow and lighting passes as usual. But that’s just a broad guess and there may be techniques I’m not aware of here. Some of this depth info may be able to be filled in programmatically if you have information from, e.g., a stereo camera.