Think that an insulated wire is wound on a soft iron core. Now without any current in the coil soft iron is not magnetized. As steady current flows through the wire then soft iron would become as a bar magnet. This magnetism would last so long as there is current in the wire. Such a magnetism is known as electromagnetism.
But there are permanent magnets. Example bar magnets.