It could possibly be just be a myth, but if it is true the reason would be because the sun heats up the molecules and particles inside of the battery causing them to become more active.
In a abstract essence, it's like giving someone caffeine because it boosts the person's energy levels. It's the same with the chemicals located inside of the battery.