What this simulation shows
Two wooden shelves each hold a bar: soft iron on the top shelf, steel on the bottom one. A bar magnet waits off to the left of each. Press Bring in and both magnets slide up to the bars together, stopping at the gap you set. Paper clips cling to the far end of each bar, and the cards count them. Press Remove and the magnets slide far away, so you can see which bar keeps its grip.
Why a magnet always attracts iron and steel
Iron and steel are magnetic materials. Placed in a magnet's field, each becomes a magnet itself: its magnetism is induced. The pole that forms at the end nearest the magnet is always the opposite kind. An N pole facing the bar produces an S pole at its near end and an N pole at its far end. Turn the magnet round and both poles swap. Either way, opposite poles end up face to face, so the bar is pulled in. That is why a magnet never pushes away an unmagnetised piece of iron.
The far end is a pole too, so it can hold paper clips, and each clip becomes a small induced magnet that holds the next.
Soft iron against steel
With the magnets touching, the soft iron holds 16 clips and the steel only 11. Iron is easier to magnetise. Take the magnets away, though, and the iron drops every clip: it keeps almost nothing, so it is a temporary magnet. The steel still holds 4. It has become a permanent magnet, if a weak one.
Leave a 3 cm gap and the difference is clearer still: the iron holds 10 clips, the steel none. A weak field magnetises soft iron strongly but steel only slightly. Steel only keeps magnetism given by a strong field, such as at the end of a magnet. Our temporary and permanent magnets practical turns this comparison into a step-by-step experiment.
Domains: what happens inside
Turn on Show the domains to see inside each bar. Every arrow stands for a domain, a small region in which the atoms' magnetic effects all point the same way. Each points to its own N end. In a new bar they face every direction and cancel out. As a magnet comes close they swing round to line up, and the domains lined up cards climb.
The soft iron's arrows turn quickly, even far from the magnet, and fall back to random the moment it leaves. The steel's arrows barely move until the magnet is close, and several of them then stay pointing along the bar.
Magnetising and demagnetising
Stroking a bar with a magnet, or putting it in a coil carrying direct current, lines the domains up. A strong d.c. coil leaves the steel holding 14 clips. Heating a magnet, hammering it, or drawing it slowly out of a coil carrying alternating current shakes the domains back into disorder. The a.c. is shown slowed down so you can watch the arrows flip back and forth.
Simplifications and course notes
Each bar is drawn with just 16 domains; a real one has millions, each roughly a tenth of a millimetre across. Real domains also change size as they line up, not just direction. The fields, the clip counts and how easily each metal's domains turn are model values chosen to show the behaviour clearly. There is no Earth's field.
AQA GCSE (4.7.1) asks how induced magnets differ from permanent ones and that induced magnetism always attracts. Cambridge IGCSE (4.1) adds soft iron as a temporary magnet and steel as a permanent one. Domains and the magnetising and demagnetising methods are in the Punjab Class 9 book (sections 8.8 and 8.9) but go beyond both of the others.