The naturally occurring magnets can attract pieces of iron and certain other materials.
When suspended freely these magnets align themselves along the north-south direction.
Magnetism was a less understood phenomenon until in Oersted discovered that an electric current produces a magnetic field.
All theoretical and practical attempts to confirm the existence of magnetic monopoles have failed.
All magnetic effects are associated with electric current.
The magnetic field produced by a bar magnet can be explained as the resultant field produced by the tiny current loops formed by the electrons revolving around the nucleus of each atom.
Source of Magnetic field
Permanent Magnet:
The material used for the construction of a permanent magnet should have high retentivity and high coercivity so that the magnet becomes strong and it becomes able to resist the loss of magnetism due to rough handling or temperature changes.
Hysteresis loss is unimportant here because a permanent magnet is never subjected to cycles of magnetization.
All these considerations indicate that steel is more suitable than soft iron for the construction of a permanent magnet.
There are some alloys like Alni , Alnico which are more suitable for the construction of permanent magnets.
Hence, permanent magnets are the most common type of magnets that produce the strongest magnetic field.
Electromagnet:
Electromagnets are formed by surrounding the soft core with a conducting wire.
When current is passed through the wire, it induces a temporary magnetic field inside the soft core.
The materials used for the construction of an electromagnet should have high magnetization at a low magnetizing field, high initial permeability, and low hysteresis loss.
Soft iron possesses all these properties and hence is best suited for the construction of electromagnets.
Also, some alloys like permalloy , mu metals , etc. are used for the construction of electromagnets.
A current conducting coil is wound around this soft iron core, which generates a magnetic field.