If we loop the single wire and pass current into this, we get a stronger magnetic field than the single straight wire. How? The magnetic field circling each loop of wire combines with the magnetic fields from the other loops to produce a concentrated field down the center of the coil.
This phenomenon where the magnetic field is created from the movement of electrical charges is called electromagnetism.