Natural sunlight on Earth is finicky. They're not talking about the sun itself. They're just using "the sun" as a shorthand for the weather, the rotation of Earth and so on. Humans sometimes do that.
a figure of speech in which a part is made to represent the whole or vice versa, as in Cleveland won by six runs (meaning “Cleveland's baseball team”).