Sunspots, seen as cool regions on the surface of the Sun, are a thermal phe
nomenon. Sunspots are always associated with bipolar magnetic loops that br
eak through the solar surface. Thus to explain the origin of sunspots we ha
ve to understand how the magnetic field originates inside the Sun and emerg
es at its surface. The field predicted by mean-field dynamo theories is too
weak by itself to emerge at the surface of the Sun. However, because of th
e turbulent character of solar convection the fields generated by dynamo ar
e intermittent - i.e., concentrated into ropes or sheets with large spaces
in between. The intermittent fields are sufficiently strong to be able to e
merge at the solar surface, in spite of the fact that their mean (average)
value is weak. It is suggested here that magnetic fields emerge at the sola
r surface at those random times and places when the total magnetic field (m
ean field plus fluctuations) exceeds the threshold for buoyancy. The cluste
ring of coherently emerged loops results in the formation of a sunspot. A n
on-axisymmetric enhancement of the underlying magnetic field causes in the
clustering of sunspots forming sunspot groups, clusters of activity and act
ive longitudes. The mean field, which is not directly observable, is also i
mportant, being responsible for the ensemble regularities of sunspots, such
as Hale's law of sunspot polarities and the 11-year periodicity.