This has long been described. Ancient man, like a small child, did not yet know anything about himself or the world around him; everything around him surprised and often frightened him. The idea that everyone is “ruled” by some higher forces, who can get angry, or they can give you a break if you “behave well”, is the simplest.
About what myths are briefly:
How likely is it that all the legends, myths, scary tales, and so on actually have a very real basis?
Why is mythology in demand by people and what is its social function?
This has long been described. Ancient man, like a small child, did not yet know anything about himself or the world around him; everything around him surprised and often frightened him. The idea that everyone is “ruled” by some higher forces, who can get angry, or they can give you a break if you “behave well”, is the simplest.