Philosophy of science

Suppose ice-cream sales and sunburn cases both rise during hot weather. Why would hot weather matter to an explanation of their correlation?