The advantage of permanent magnets is that they are magnetic without being energized, which can be used to solve the problem of magnetic field in some products, but not energized position due to the process requirements.
The advantage of the electromagnet is easy to control, the magnetic field can be changed according to the need to change its size, magnetic pole direction.