Compositing is the combination of multiple layers of images or video elements to render a final still or moving image. The combination of layers can be a physical or software-based operation. Rotoscoping is one compositing method.
Compositing is often used for 2D content, layering multiple images and print for still images in advertisements, memes and other content for print publications, websites and apps. The technique is also used in animation where parts of characters and backgrounds are layered to make it easier to animate moving parts and eliminate the need to redraw parts that remain unchanged. Depth can be simulated in backgrounds by moving layers at different rates appropriate to distance, a technique known as parallaxing that is often often performed in compositing for cartoons.
For television, compositing on green screens is often used to provide virtual backgrounds and sets. Augmented reality (AR) uses compositing techniques for various purposes, such as displaying layers of images at different levels of depth in a display. The combined layering technique is also used in motion pictures. In pictures depicting faraway or imaginary places, compositing may be used along with green screens to create convincing background visuals. CGI (computer-generated imagery) effects are added to films with compositing as well.
See an introduction to the basics of compositing in Blender: