The reason behind it is that a moving charge or a current sets up or creates a magnetic field in the space surrounding it. That's why the current carrying conductor behaves as a magnet. This shows that the magnetic field is associated with a current carrying wire.