  The level of solar magnetic activity, as exemplified by the number of
sunspots and by energetic events in the corona, varies on a wide range of time
scales. Most prominent is the 11-year solar cycle, which is significantly
modulated on longer time scales. Drawing from dynamo theory together with
empirical results of past solar activity and of similar phenomena on solar-like
stars, we show that the variability of the solar cycle can be essentially
understood in terms of a weakly nonlinear limit cycle affected by random noise.
In contrast to ad-hoc `toy models' for the solar cycle, this leads to a generic
normal-form model, whose parameters are all constrained by observations. The
model reproduces the characteristics of the variable solar activity on time
scales between decades and millennia, including the occurrence and statistics
of extended periods of very low activity (grand minima). Comparison with
results obtained with a Babcock-Leighton-type dynamo model confirms the
validity of the normal-mode approach.
