How does a spinning electron produce a magnetic field? I learned in my undergraduate physics class that atoms have magnetic fields produced by the orbit of electrons and the spin of electrons. I understand how an orbit can induce a magnetic field because a charge moving in a circle is the same as a loop of current. 
What I do not understand is how a spinning ball of charge can produce a magnetic field. Can someone explain how spin works, preferably in a way I can understand?
 A: Lets take the rotating "spherical ball" analogy seriously (actually a torus below).
The electron is modeled as a tiny stationnary torus rotating at an angular velocity $\omega$ around the symmetry axis passing through its center of mass.  The material on the torus is moving at velocity $v = \omega \, r \le c$.  The classical spin angular momentum is then $S = r \, p$ where $p = \gamma \, m_0 v$ is the linear momentum of the rotating material on the torus.  $\gamma = 1/\sqrt{1 - v^2 /c^2}$ is the relativistic factor.  You get the spin angular momentum
\begin{equation}\tag{1}
S = \frac{m_0 \, \omega \, r^2}{\sqrt{1 - \frac{\omega^2 r^2}{c^2}}}.
\end{equation}
Now, lets take the limit $r \rightarrow 0$ (spinning point-like electron, or a dot spinning on itself!).  Is it possible to apply that limit in such a way that Eq(1) above gives some constant?  Of course, the trivial solution is $S = 0$ if we consider $\omega$ as an independent variable.  But there's also a non-trivial solution if we also take the limit $\omega \rightarrow \infty$ in such a way as $v = \omega \, r \rightarrow c$ (so the relativistic factor goes to infinity).  Considering $S$ as a non-trivial constant, you get the spinning angular velocity as a function of the torus radius :
\begin{align}
\omega &= \frac{S/m_0}{r \, \sqrt{r^2 + (S / m_0 c)^2}}, \tag{2} \\[12pt]
v &= \omega \, r = \frac{S/m_0}{r^2 + (S / m_0 c)^2}. \tag{3}
\end{align}
The limit $r \rightarrow 0$ then gives $\omega \rightarrow \infty$, $v \rightarrow c$ (and $\gamma \rightarrow \infty$), and $S$ a non-trivial constant !
This is the same kind of non-trivial relativistic solution that you get for a massless particle : $m_0 \rightarrow 0$, using the energy and linear momentum :
\begin{align}
E &= \gamma \, m_0 c^2, \tag{4} \\[12pt]
p &= \gamma \, m_0 v, \tag{5} \\[12pt]
v &\equiv \frac{p \, c^2}{E}, \tag{6} \\[12pt]
E^2 &= p^2 c^2 + m_0^2 \, c^4. \tag{7}
\end{align}
The limit $m_0 \rightarrow 0$ trivially gives $E = 0$ and $p = 0$ (so the massless particle doesn't exists!).  But you also have the non-trivial solution $m_0 \rightarrow 0$ and $v \rightarrow c$ such that $\gamma \, m_0$ remains finite and $E = p \, c$ is a finite non-trivial constant.
According to the torus model above (or a sphere, or any other shape), we can model an electron as a small ring of charges rotating in such a way that it produces a magnetic field, even under the limit $r \rightarrow 0$ (spinning dot model!).  This is possible because of relativity (i.e. the gamma factor).
The ring model above has a fatal defect : total energy $E = \gamma \, m_0 c^2$ diverges, if $m_0$ is a simple constant, while $\gamma \rightarrow \infty$!  For the torus, we would like to get $E = \gamma \, m_0 c^2 = m_e c^2$ (a finite non-trivial constant) for a tiny torus.  This imposes
\begin{equation}\tag{8}
S = \gamma \, m_0 \, \omega \, r^2 \equiv m_e \omega \, r^2.
\end{equation}
Keeping $S$ a constant implies
\begin{align}
\omega &= \frac{S/m_e}{r^2}, \tag{9} \\[12pt]
v = \omega \, r &= \frac{S}{m_e \, r}. \tag{10}
\end{align}
The minimum radius cannot be 0 :
\begin{equation}\tag{11}
r_{\text{min}} = \frac{S}{m_e c} = \frac{\hbar}{2 m_e c},
\end{equation}
which is about the Compton length.  Under this limit (i.e. $r \rightarrow r_{\text{min}}$), we get $v \rightarrow c$, $\gamma \rightarrow \infty$, $m_0 \rightarrow 0$, while $E \rightarrow m_e c^2$ and $S = \frac{\hbar}{2}$.  According to this rotating massless ring model, the electron cannot be turned into a point particle.
A: There is no classical analogue to visualise what spin is. We found out from experiments that particles have an intrinsic property which we named spin which produces a magnetic moment. You cannot visualise it since fundamental particles are zero-dimensional points in space so the term "spinning around its axis" makes no physical sense.
Its a strictly observational effect which fits well with our mathematical models and explains a great range of phenomena in nature.
A: An electron is not a spinning ball of charge and the intrinsic spin of particles cannot be understood in such terms. Not only is it difficult to make sense of what it means for a pointlike particle to spin, but also when treating the electron as a spinning ball of charge one finds a value of the ratio between the magnetic moment and the angular momentum that is a factor $2$ too small.
To understand why a rotating charged ball generates a magnetic field, note that every charge on the ball will move in a circle, so there is in fact a current, and that current will generate a magnetic field.
A: Another way to visualize electron spin is to consider the "Dirac Electron"
Dirac's one equation for a massive particle can be rewritten as two equations for two interacting massless particles, where the coupling constant of the interaction is the mass of the electron.
We can follow these rules and visualize a current loop capturing an orthogonal magnetic field. This way you can represent both electrons and anti-electrons as left or right handed particles. These particles can also exist as either up or down state relative to its environment.

These coupled spinors spin orthogonal to themselves. From the direction of spin, you can see there is no way to push the electron and anti-electron together without destroying them.
Also note, turning the inner (blue) loop 360 degrees, only turns the larger (red) loop 180 degrees leaving it upside down. You must turn another 360 degrees (720 total) before it is right side up.
A: Electrons don't spin.  It is just what they decided to call a certain intrinsic property.  They could of called it the X factor or magnetic factor but they called it spin for some reason
A: It can be proven that nothing "rotates" in an electron. Its spin angular momentum $\hbar/2$ is completely included in its electromagnetic field with the assumption that the "dressed" electrons magnetic flux is precisely on flux quantum (fluxon) $\Phi_{0} = h / 2 e$. Generally, if a charge q is immersed in a magnetic field of flux $\Phi$, a "hidden" canonical electromagnetic  angular momentum $L = q \Phi/ 2 \pi$ is generated. Substitute $q = e$ and $\Phi = \Phi_{0}$ and you will get $L = \hbar/2$.
A: I really like the explanation on or about 29:30 of this older video. He causes the electrons to start spinning around the torus with the magnet, trapping the magnetic field lines orthogonal to the spinning electrons.
 
https://www.youtube.com/watch?v=BFdq6IecUJc#t=1729
In his words "As the magnet is removed, the magnetic flux remains trapped within the tin ring. The trapped magnetic flux induces a current flow around the ring. The current flow causes the tin ring to act as a magnet. The magnetic property of the ring has been observed to persist for months at a time forcing the conclusion that there is no resistance to the current flow."
A: Electron is not like a ball, as it has no volume at all. So it can not spin like a ball. Magnetic moment comes "as is" from  quantum mechanics, which do not explain its nature.
