Wire carrying current $I$ immersed in magnetic field $\vec B$ . $\vec F$ shows the force on the wire due to the $B$

Untitled

Force bewteen two long wires carrying currents (paper)

We observe that the two wires attract to eachother. If the direction of current in one wire is changes, wires repell each other. How can we understand and explain this?

Untitled