How do you think the magnet able to turn “on” and “off”?

Answer:
When in the OFF position, all of the magnetic attraction is somehow contained inside. It doesn't stick to steel. Touch the bottom of the magnet to a steel surface that you want it to stick to, and turn the knob.