Why does a piece of iron behave like a temporary magnet when placed in a magnetic field?
Under normal conditions, a magnetic material like iron doesn’t behave like a magnet because the domains don’t have a preferred direction of alignment. On the other hand, the domains of a magnet (or a magnetized iron) are all aligned in s specific direction. Domains are separated from the adjacent domains by domain walls. In general, alignment within a domain is the same for all atoms of that domain. However, the atoms of one domain are aligned in a different direction than the atoms of another domain. This situation is sketched below for a magnetic material, a magnetized material, and a nonmagnetic material. A nonmagnetic material doesn’t have any domain structure.
Domains can be induced into alignment. Consider a common iron nail. Its domains are randomly oriented, like the first picture above. If you bring a magnet is brought nearby, the domains of the iron nail will align in such a way that the north pole of iron domains will face the south pole of the magnet and vise Versa.
When you remove the magnet, the nail becomes a permanent magnet for a while. The thermal motion (remember the higher the temperature, the faster the atoms move) of atoms eventually may cause most of the atoms to return to random orientation. Also, by dropping a magnet, not only will you break it, but you will also destroy the domain alignments.
Another way of making a permanent magnet is to stroke a piece of iron (or iron shaving, which you will do as an activity) with a magnet. Iron shaving behaves like tiny magnets.