Iron comes in two forms, hard and soft. If you were hit on the head with a soft iron bar, it would still feel very hard; soft is simply a term describing the magnetic properties. In hard iron, the domains will not shift back to their starting points when the field is taken away. In soft iron, the domains return to being randomly aligned when the field is removed.
Hard iron is used in permanent magnets. To make a permanent magnet, a piece of hard iron is placed in a magnetic field. The domains align with the field, and retain a good deal of that alignment when the field is removed, resulting in a magnet.
An electromagnet, in contrast, uses soft iron; this allows the field to be turned on and off.