>>9907254For reals, that's a question which has plagued me for years. I even did an extensive education to figure it out. Turns out electrons have a spin, and when they move, the spin aligns with the direction of movement. If enough of them are aligned, the crystalline structure warp, and the flux leakage drives an increase in entropy, or disorder in the material, for it to return to its chaotic configuration. Hardening a material slightly, solidifies its magnetic properties, and when the temperature reaches the curie point, it's demagnetized out of disorder in the domains. For the attractive/repulsive force, realignment of polarization induces physical movement, such that the current is minimized. Handwavy, but oh well.
TL;DR: Magic.
https://www.youtube.com/watch?v=sENgdSF8ppA