It's a pretty simple effect. Basically, the side you first see of the cage has half a butterfly and a mirror. Because a butterfly is a symmetrical animal, the reflection in the mirror makes it look like the butterfly is a complete animal. Once you pass the cage, you are looking at the other side, which has only half a bar and a mirror. The mirror reflection looks like it is still the complete bar, but without the butterfly. The two mirrors are back to back. Because the outside cage is continuous, you don't notice that there are actually two back to back mirrors, giving the illusion that the butterfly disappears. Additionally, both of the bars are moving at the same speed, so your brain really sees it as one image.
Hopefully that makes sense.