There are lossless compression techniques and lossy compression techniques.
As far as your query is conserned the data corresponding to the unchanged part will be lost. Suppose the vedio is like your friend dancing infront of a wall. Since for all the frames the data corresponding to the wall remains the same that much data will be removed from the successive frames excluding the initial frames of the vedio.
This is the very simplest explenation. Hope you get the concept.