Computer-generated imagery (also called just "CG" for computer graphics) means creating images by doing mathematical calculations with a computer. CG has caused big changes in the way visual effects for movies are made, because a lot of things that are hard to do in the real world are easy in the computer. There are several steps to creating a CG element in a film: modeling, animation, rendering, and compositing.
It all begins with an artist who makes drawings, photographs, or clay models that show what the director wants. This could be a car being crushed by the Hulk, an actor doing impossible fight moves, or even a human-like character (like Gollum in The Lord of the Rings) who coexists with real actors in the final film. From these models and drawings, a person called a modeler works with three-dimensional shapes on the screen to create a matching computer model. Sometimes clay models or actors' faces are scanned using special laser scanners to give the modeler something to start from.
When the model is perfect, an animator tells the computer how the model should move -- for example, how the car flips over when the Hulk steps on it, or how Gollum's face moves as he talks. Sometimes the animator incorporates motion that is "captured" from real actors (Gollum was done this way) or simulated based on physics (for example, to make the car's roof buckle realistically).
Once the modeling and animation are complete, an imaginary camera and lights are set up within the computer, and a program called a renderer runs for a long time (often an hour or more for every single frame) to create images that show the moving 3D model. A technical director fine-tunes the lighting and the materials, rendering the scene over and over until it looks just right. The CG images are then combined with the live-action elements (for example, shots of real actors or background landscapes) using compositing software that seamlessly blends them to create the final frames of the film.
So as you can see, those stunning special effects involve tons of painstaking craftsmanship, whether they're done with miniatures and pyrotechnics in the real world or with bits and bytes in the computer. And when the work is done, scenes that existed only in the director's imagination become part of the movie's world.