Well, the short answer would be; All of those gods were created by humans to control humans.
The long answer goes several ways. Mainly there are religious and non-religious gods. You already know religious ones. Non-religious ones are the ones who are locally worshipped; like ‘Minneri Deyyo’. And then there are mixed gods.
Non-religious gods
These are non-religious in the sense they are not gods because of religion. They are usually very local. They are actual humans who have been working for society and then after their death people started to worship them giving them a ‘god’ title. As I mentioned before, ‘Minneri Deyyo’ or even Pharaoh Kings wanted to be worshipped as gods. Or so they did forcibly.
Religious gods
When humans are becoming social animals, they needed leaders. Animals have leaders too but the main difference with humans is, humans somehow had a need to be civilised about choosing a leader. Because every human is now intelligent with the ability to think more than the other animals, so the internal competition was way too bigger than it is between other animals. So physical strength wasn’t enough to be the leader. They needed something else.
Thunder, fire and rain
These early humans might have seen many natural phenomena like thunder, wildfire and stuff that frightened them. Those experienced leaders might have known where lightning strikes are less prone to happen, where the safe drinkable water is and etc. So they might have protected their people from getting killed.
“I will protect you”
These so-called leaders might have started to use that knowledge to deceive the rest, saying, “The thunder (or another similar phenomenon) is coming from some superior power and I’m the representative of that superior power so I know how to protect you from the wrath of this superior”. You know how the story goes. So these deceptive bastards created the concept of “God(s)”. Also, they have made people worship trees, thunder, fire, rivers and all those natural stuff with some rituals because these leaders needed to keep the others remembering these stuff 24×7, so they can keep oppressing them.
Super gods
Fast forward five to two thousand years ago. They couldn’t control the masses with old stories so they had to create new gods and super-gods. And worshipping methods have been upgraded. Those slowly formed into religions with representatives of the leaders called priests to handle the crowd.
So the leaders (later became rulers) can go to war with each other knowing that their servant priests are keeping their people under their control. So religions continued to control the masses as same as the rulers wanted, in the name of god or other concepts that are developed later during the development of civilisations. Rulers and religions always have had a close relationship in this regard as it is nowadays.
It always has been the same
See how things haven’t changed much even in the 21st century. We are still controlled by the primitive controlling methods that our ancestors once were controlled more than 20,000 years ago.
Mixed gods
In some areas, those older concepts continued to grow despite the organised religions have taken over. A fine example is Greek gods. They have designated gods for fire, wars, water, seas, thunder and everything. It’s in a grey area between religious and non-religious gods.
Some areas have local non-religiously ‘born’ gods that have become part of religions. Like the god ‘Sumana saman’.
So yeah all of them are created by rulers to control and deceive the commoners.
This article has been written as an answer to a question raised by a friend on Facebook.