An electric current creates a magnetic field. That's been known for a long time, but when physics is taught this is one of those things which is just stated, which I find a shame because the explanation is both simple and amazing.
First, we have to accept the consequences of there being a universal speed of light, observed by anyone no matter how they are moving. Given that, things that are seen to be moving relative to an observer will show various effects. Firstly, time will appear to slow for these things. Secondly, lengths in the moving objects will seem to be shorter in the direction of movement. Thirdly, moving objects will seem heavier than when they are at rest. What matters for magnetism is the second effect - the contraction of length.
Now, imagine two parallel wires, each with an electric current flowing in the same direction. First, let's look from the point of view of the positive nucleii of atoms on one of the wires. Electrons in the opposite wire will be seen to be moving, and because of this distances between them will seem to be shorter, and so there will appear to be an increased density of negative charge. Now let's look from the point of view of the moving negative electrons in one of the wires. Nucleii in a second, opposite wire will be seen to be moving (backwards relative to the electrons in the first wire), and so there will seem to be an increased density of positive charge.
The increased densities of charge because of relativistic length contraction results in an attraction between two wires carrying electric currents in the same direction. This is what magnetism consists of - a very, very, very tiny excess of electrostatic forces. It's small because the movement of electrons in an electric currents we use to generate magnetism is extremely small - it's typically measured in metres per hour. (Electricity is the signal for electrons to start moving, and that can travel very quickly). That we can make magnetism at all with our technology shows how incredibly strong electrostatic forces are.