As they keep the iron piece in contact with the magnet, it attracts the iron piece.

After some time the iron piece also starts attracting the other iron piece with a very small force of attraction.

It means that the iron piece acts like a magnet and attract the other iron towards it.

The iron piece behaves like a magnet because of magnetic hysteresis.

Let's understand magnetic hysteresis and hysteresis loss

Ferromatics are the material which has strong magnetic properties.

And on applying the magnetic field, their dipoles align themselves parallel to the magnetic field.

The domain structure of ferromagnetic material is as

The ferromagnetic contains dipoles and, which have a random direction as

When the magnetic field$(B)$ is applied to the ferromagnetic material, its dipole moments align themselves in one particular direction as shown,

And these poles are in the direction of the magnetic field.

So, we say that the ferromagnetic material has been magnetized.

But if we change the direction of the magnetic field to demagnetized it.

Then we see that some atomic dipoles are also in the previous direction.

Therefore, the ferromagnetic material has the property of the magnet after removal of the magnetic field.

Let's understand the phenomenon of hysteresis loop with the help of a solenoid.

Consider, a ring of magnetic material wound uniformly with a solenoid.

The solenoid is connected to a voltage source to produce the current.

Initially, the position of the switch is $1$.

As we have studied that the current is inversely proportional to the resistance.

So, by decreasing the resistance, we can increase the current flowing in the solenoid resulting in a gradual increase in magnetic field intensity.

And as a result, the flux density also increases till it reaches the saturation point.

The magnetic flux density is defined as the flux generated per unit area and denoted by $B$.

Saturation occurs when on increasing the current the molecules of the ferromagnet material align itself in one direction.

The magnetizing force represents the number of amperes terms per unit length of the solenoid.

The magnetizing force is directly proportional to the applied current.

But the value of flux density will not be zero as it still has the value ob when $H=0$.

So, we obtain the curve that is called the magnetic hysteresis loop.

When we demagnetize the solenoid then the path followed is $abcd$.

And the value of flux density will not be zero.

This loop is very important in the memory capacity of devices for audio recording or magnetic storage of data on computer disks.

Revision

When a ferromagnetic material is magnetized in one direction, it will not relax back to zero magnetization when the imposed magnetizing field is removed.

So, we obtain the curve that is called the magnetic hysteresis loop.

The magnetic flux density is the flux generated per unit area and denoted by $B$.

The magnetizing force represents the number of amperes terms per unit length of the solenoid.