Exchange spring magnet
The magnetostatic energy is the energy stored in the field generated by a material's magnetic moments. The magnet's field reaches its maximum intensity if all the magnetic moments orient in one direction; this is what occurs in a hard magnet. In order to prevent building up the magnetic field, sometimes magnetic moments tend to form loops. That way, the energy stored in the magnetic field can be constrained; this is what occurs in a soft magnet. What determines whether a magnet is hard or soft is the dominant term of its magnetic energy. For hard magnets, the anisotropy constant is relatively large, making the magnetic moments align with easy axis. The opposite case applies to soft magnets, in which the magnetostatic energy is dominant.
Electricity
Ørsted did not fully understand his discovery, but he observed the effect was reciprocal: a current exerts a force on a magnet, and a magnetic field exerts a force on a current. The phenomenon was further investigated by Ampère, who discovered that two parallel current-carrying wires exerted a force upon each other: two wires conducting currents in the same direction are attracted to each other, while wires containing currents in opposite directions are forced apart. The interaction is mediated by the magnetic field each current produces and forms the basis for the international definition of the ampere.
This relationship between magnetic fields and currents is extremely important, for it led to Michael Faraday's invention of the electric motor in 1821. Faraday's homopolar motor consisted of a permanent magnet sitting in a pool of mercury. A current was allowed through a wire suspended from a pivot above the magnet and dipped into the mercury. The magnet exerted a tangential force on the wire, making it circle around the magnet for as long as the current was maintained.