What causes magnetic force?
Subatomic particles (electrons, protons, etc.) have a property called spin. Unlike most properties, spin can only take two values, called 'up spin' and 'down spin'. Usually, the spins of the subatomic particles are all opposites, cancelling each other out and making the overall spin of the atom zero.
Some atoms (eg, iron, cobalt and nickel atoms) have an odd number of electrons, so the overall spin of the atom is up or down, not zero. When the atoms in a lump of this material all have the same spin, the spins add up and the effect of such a large spin is what we call magnetism.
Minute Physics has made a good video explanation here: