What makes an electromagnet work?
It is based upon the principle that a current produces a magnetic field. A simple electromagnet is a wire wrapped around a core made up of a magnetic material such as Iron. On passing a current a magnetic field is produced which aligns the initially randomly aligned magnetic domains in the core producing a stronger magnetic field. Note that the field almost completely disappears when the current is switched off unlike a magnet which has a permanent field.