A current carrying conductor has it's own magnetic field. Since a moving charge has both magnetic and electric fields, a current carrying conductor means a continuous motion of charges within the conductor. And an electric current exerts magnetic force on other electric currents in its influence. It means one current carrying conductor can exert force on other current carrying conductors.

Here we consider two parallel straight current carrying conductors or wires separated at a distance \(d\) each with length \(L\) as shown in Figure 1.

Figure 1 The magnetic field due to upper conductor at the lower conductor is directed into the screen being perpendicular to the lower conductor. Both conductors exert force on each other and attract each other.

Both conductors exert force on each other. Here we focus on the force exerted by the upper conductor on lower conductor for now. The upper conductor or wire exerts force \(\vec F_1\) on the lower conductor and let the magnetic field due to the current in the upper conductor be \(\vec B\) and this field encloses the lower conductor and exerts force on it. The magnetic force exerted by the upper conductor on the lower conductor is given by

\[F_1 = I_2LB\sin \theta \tag{1} \label{1}\]

where the angle \(\theta \) is the angle between \(\vec B\) and \(\vec L\) which is always \(90^\circ\), so \(B = I_2LB\). The direction of magnetic field \(\vec B\) due to upper conductor at the lower conductor is directed into the screen (indicated by cross symbol in above figure) and it is always perpendicular to the lower conductor. Note that \(\vec L\) has the same direction of current (by saying that it does not mean that current is a vector quantity). But we know the expression of magnetic field for infinitely long straight current carrying conductor, and therefore the magnetic field magnitude \(B\) is

\[B = \frac{\mu_0I_1}{2\pi\,d}\]

Now substituting the value of magnetic field in Equation \eqref{1}, the magnetic force \(F_1\) is

\[F_1 = \frac{\mu_0I_1I_2 L}{2\pi\,d}\]

You'll get the same expression for the magnetic force \(F_2\) due to lower conductor on the upper conductor, so the magnitude of magnetic force on both conductors is the same. The magnetic force on one conductor due to another is

\[F_B = \frac{\mu_0I_1I_2 L}{2\pi\,d}\]

Note that the magnetic force due to upper conductor on lower conductor is upward. And similarly you can understand that the magnetic force due to lower conductor on upper conductor is downward. Hence if the currents in both conductors are in the same direction, the conductors attract each other. You can easily determine this using right hand rule. If you reverse the direction of current in one conductor, the conductors repel each other.

The magnetic force per unit length is

\[\frac{F_B}{L} = \frac{\mu_0I_1I_2}{2\pi\,d}\]

The SI unit of electric current Ampere (A) was defined in terms of the force per unit length between two parallel current carrying conductors. But the Ampere is redefined in terms of elementary charge to be effective from May 20 2019. Here is how the ampere was defined.

If two parallel conductors separated at a distance of \(1 \text{m}\) carrying the same current exert forces on each other with magnitude of \(2 \times 10^{-7} \text{N/m}\), the current in each conductor is defined to be exactly one Ampere.