This property is known as magnetic permeability.
To quote an article by Dura Magnetics, which explains it better than I can:
By applying an external field, some metal alloys can have a net field created. This created, or induced, field is only present when the external drive field is applied. Once the external drive field is removed, the induced field is also removed.
For example, a permanent magnet is attracted to a ferrous object because magnetism is induced in the object by the magnetic field emanating from the permanent magnet. A magnet is not attracted to materials such as wood because no internal field is induced in the wood. With no induced internal field, there is no field interaction and no attraction.
Two pieces of steel do not attract to each other because they do not induce fields in each other: no field, no interaction, no attraction.
The degree of the induced magnetism is related to the ferrous material’s magnetic permeability, expressed as a unitless value designated by the Greek letter mu (μ). The higher the material’s permeability, the greater the magnetic induction and the resulting force of attraction.
It is useful to compare high magnetic permeability and low magnetic permeability materials to better understand the difference in what magnets are attracted to.
Low permeability materials are materials that are not attracted to a magnet, such as air, wood, plastic, and brass. There is no magnetism induced in them by an external magnetic field. Therefore, they are not attracted by a magnet.
High permeability materials such as ferrous materials, Nickel, and Cobalt alloys have a high permeability. Therefore, magnetic fields can be induced in them when exposed to an external magnetic field.