Motion capture (mocap) is the process of recording the movements of real people, animals or object paths and analysing that data or mapping the movements onto a CG character so the digital character moves just like the real actor.
The very early stages of this technique were called rotoscoping, this involved taking the performances of actors in a live action set and basically tracing over their movements with a pencil and paper. Animator Max Fleischer invented "rotoscoping" in 1914, a method of creating cartoons like Out of the Inkwell by tracing live-action footage, frame by tedious frame. The first use of rotoscoping in a feature film was in Disney's Snow White and the Seven Dwarfs from 1937.
Motion capture is heavily used in the video game industry and is also utilised in both live action films as well as full feature length animated movies. The film Polar Express was the first full length feature film to use motion capture entirely. Early on, mocap was a studio-only process where tight-suited actors were alone in barren sets surrounded by special cameras and lights. Avatar introduced "performance capture," which added multiple performers, facial expressions and lip movement. Games like L.A. Noire also drastically improved realism by combining facial and full-body capture. Lord of the Rings, meanwhile, brought mocap out of the studio and onto the set, allowing pioneering mocap actor Andy Serkis to interact with other actors as Gollum.
There are several different methods to get the motion capture data, the one you’re probably most familiar with is using the suits with the small lights or reflective balls that are placed on the different areas of the actor. This is called Optical motion capture, either passive or active depending on the markers you are using. Optical systems work by tracking position markers or features in 3D and assembling the data into an approximation of the actor's motion. Active systems use markers that light up or blink distinctively, while passive systems use inert objects like white balls or just painted dots (the latter is often used for face capture).