Magnetic force is not real. It is part of the electromagnetic field, but it is useful fiction.
A magnetic field appears to be an electric field, but it is actually just electrical fields that are changing in intensity or direction. Special Relativity can be used to analyze the situation and show exactly the same effects as what we observe experimentally.
Maxwell, a brilliant man who used the knowledge and experiments we had at the time, created four equations [1] which accurately describe electric and magnetic field. However, relativity was not yet discovered.
Imagine two wires running parallel to one another, but only a few feet apart. They are both neutral in their overall charge and have as many electrons per protons.
Let’s say that there is an electron current flowing through each wire in the opposite direction. Still neutral.
However, it is best to view it through the lens of an electron. It appears normal to all of its brethren. The Lorentz Contraction , which is length contraction due special relativity, makes the electrons in the wire moving in the opposite direction appear closer together. These electrons make this wire look closer together. Lorentz Contraction makes the protons in each wire appear closer (from the perspective of moving electrons), but at half the velocity (simplification).
The moving electrons are attracted to the wire with more negative than positive charges. The positive nucleus is pulled along.
You will notice that I have never invoked a magnetic force.
This is how I calculated the effects (many smarter than myself have done it). The repulsion between wires matches Maxwell’s equations and experimental results up to many, many decimal points [3]. This example can be rerun with electrons moving in the opposite direction. Experimental results prove that wires attract.
You might be thinking that electron drift velocity is slow for high currents. There are a lot of them moving, 6.24×1018 per ampere. The electric field is very powerful so it all adds. The magnetic fields that are created are actually quite weak. To boost the magnetic field, we must wind several turns around an electron magnet and place an iron core inside it. Each turn of a coil adds to the field even though it is the exact same current. Two wires running in a loop that has 1A current will have the same magnetic field effect as one wire running with 2A current.
It is not uncommon to create an electromagnet that has a thousand turns or more and to add an iron core to increase the effect.
TL;DR: There is no magnetic force. It is Special Relativity and moving electric charges that give the impression that there is a magnetic force. However, the calculations using the older equations that ignore Special Relativity are easier and it is easier to understand it as separate fields, so we will continue to teach it this way. This, and inertia.
The same Maxwell’s Equations predicted radio waves. As we do in antennas with slush electrons, the angle of the electric fields changes, which propagate at the speed light. Special Relativity and the moving electric fields create a magnetic field that appears at 90 degrees to this moving electric field.
For more information, click here
Relativistic electromagnetic electromagnetism
Chris White’s top answer:
How can moving charges create magnetic fields?
This playlist contains MIT lectures that will help you understand the subject better.
8.02 Physics II, Electricity and Magnetism Spring 2002 (Complete Lectures By Walter Lewin).
Or, just this one on magnetic fields and relativity
This is how an electrical current creates a force that appears to be a magnetic field. It is not clear if anyone can answer the question “why”, but it all depends on what you mean.