I'm certain it has something to do with voltage levels as the PIC loses power.

IOC flags are randomly triggered when VDD is cut with a switch, but not on MCLR.

Values are READ from DATA at PIC start-up. IOC flags on pushbuttons are used to swap values left to right, then WRITE back to memory.* By the end of the video, all values have swapped places without pushing any buttons.