The soft iron inside the coil makes the magnetic field stronger because it becomes a magnet itself when the current is flowing. Such a coil-iron core setup is then called an electromagnet. Soft iron is used because it loses its magnetism as soon as the current stops flowing.