Understanding the solar dynamo