When the circuit is closed, the piece of metal becomes magnetic when the electrical current travels through the wire.

6