The soft iron inside the coil makes the magnetic field
Stronger because it becomes a magnet itself when the current is flowing. That is, Soft iron is said to form a temporary magnet. In this way, the electromagnet can be switched on and off by turning the electricity on and off.