Why do you curl the wire when making electromagnets?
We know from Biot Savart law that a current carring wire will generate a magnetic field surrounding the wire.

\$ B = \frac{\mu_0 I}{2\pi r}\$

or more generically: \$\oint B\space dl = \mu_0I_{enc} \$  



Now if the wire is looped it can be seen that the direction of the magnetic flux starts to concentrate in the centre of the loop.



With more loops the flux is further concentrated