In film, chroma keying is a technique for compositing two images together in which a color from one image is removed, revealing another image behind it. This technique is also referred to as "greenscreen" or "bluescreen", since green and blue are considered the colors least like skin tone.
Here's a video that shows a few examples of this technique as employed within the entertainment industry. What you see in movies and television shows, was originally filmed like this.