The trick in the video is that the magnets are made of a conducting material and they connect the battery terminals to the copper wire, so the battery, magnets and copper wire make a circuit that generates a magnet field just in the vicinity of the battery. The geometry means the two magnets are automatically at the ends of the generated magnetic field, where the field is divergent, so a force is exerted on the magnets.
What you need:
- Neodyum magnets
- Dry cell battery
- Copper wire
The magnets have been carefully aligned so the force on both magnets points in the same direction, and the result is that the magnets and battery move. But as they move, the magnetic field moves with them and you get a constant motion.
If you flipped round the two magnets at the ends of the battery the battery and magnets would move in the reverse direction. If you flipped only one magnet the two magnets would then be pulling/pushing in opposite directions and the battery wouldn't move.