Same way as lenticular animation (which is basically the same thing except it's using refraction instead of masking stuff with vertical bars). The frames are cut into vertical strips and arranged so that as the mask moves across the paper, you can only see the strips that make up one frame at any one time. More or less.