I don't know with any certain knowledge but I imagine it uses the same logic that rain, etc. uses by using the Weather Channel data as sort of a Farmer's Almanac prediction. Basically based on weather patterns in the city you're playing in, it will randomly select the weather based on percentages.