In MPEG video, you have keyframes and if you are just removing a section of video (eg. an advert from a recording) then it can keep the data up to the removal point, and generate a new keyframe after the edit and just re-encode the data until the next keyframe. This keeps the original quality and is also a lot faster since less data needs to be processed.