My understanding of how it works is that the magnet induces magnetism in the (presumably soft iron) parts of the couplers. The couplers will both be of the same pole, as their magnetism is induced from the same source, and, thus, they will repel each other. They can each only swing to one side - and, as they are necessarily facing each other, this means that they will swing in opposite directions, away from each other, thus uncoupling.