He was invented, in the manner of previous deities - singular or plural, to account for the seasons or anything else that could not be explained with existing knowledge for that time.
As populations grew in size leaders sought to control their group(s) by advocating religion as a social glue...