The most promising model for explaining the origin of solar magnetism is the flux transport dynamo model, in which the toroidal field is produced by differential rotation in the tachocline, the poloidal field is produced by the Babcock–Leighton mechanism at the solar surface and the meridional circulation plays a crucial role. After discussing how this model explains the regular periodic features of the solar cycle, we come to the questions of what causes irregularities of solar cycles and whether we can predict future cycles. Only if the diffusivity within the convection zone is sufficiently high, the polar field at the sunspot minimum is correlated with strength of the next cycle. This is in conformity with the limited available observational data.