Construction of Anime Frames
When a frame of anime is made, there are different layers to the images. These allow for easy editing of a particular component.
Here's an example image (taken from Wikipedia) .

Presume that we are releasing an anime about this bird and this is the image that comes up in the title screen. We are ready to release the first episode, but the director says "actually, that bird is too far to the left, we need to change it.".
If our image didn't have layers, when we move the bird we won't know what was behind it originally, leaving a hole in the image:

Because we're a very experienced set of animators however, we know that we should use layers. We have one layer with the background on it, and another layer that is transparent apart from the image of the bird. Moving the bird layer should be much less painful now.


It is by using layers in images, that animators can put in other mediums such as 3d, or real-life photos with ease.
How 3D can be put onto 2D?
Here's an example 3D model that I found of a motorbike within a 3D editor:

In the editor, you can control the camera (left) and the lighting(right) [both highlighted in orange] of the scene. This particular scene only has one light source, but you could have several.

Editors usually allow the user to render a 2D image of what the camera can see. By moving the camera around, you could get all the images you need for the frames. You can then insert them on their own layer of the 2D images.

There are some problems with this approach though, A better way of getting the result though. If there are multiple movements in the system it is hard to do keep track of their timing from frame to frame. Also, if other camera angles are requested by the director, the process must being again. For this reason, making scripted movements is a much better approach. The frame-by-frame solution would work well for objects such as parked cars, or objects with little movement.
Manual setting of movements (examples: rotate wheel of bike 5rps, 'turn 30degrees left after 4 seconds) and Key Framing is how an animator sets up this system.

3D animators can then export the animation as several images, as seen from the camera's point of view. They can then be added to the layers of the 2D frames.
And if the director wants to change an angle, all the 3D animators have to do is move the camera and regenerate the images.
I'm not 100% certain about this but I imagine that the moving 2D parts of a frame are done after the 3D rendering as 3D's precise movements would make it hard to adjust for the 2D's less refined movements, wheras 2D is easily changeable to accomidate the 3D models - it also allows the camera angles to be changed early on.