To try to understand how the myths and legends emerged, we have to make an effort, move into the tunnel of time into the past and try to think as primitive men thought.
These men observed the phenomena of nature without understanding them. They did not have the support of science, which at the time, did not exist.
With the myths and legends men explained the seasons of the year. Rains, floods and droughts. Lightning, tidal waves and earthquakes. Beauty, love, war, death and many other mysteries they did not understand. All these enigmas and mysteries were attributed to the gods in the form of myths and legends.
These myths were exalted to become a form of religion.
For this reason, the mythological gods, intricately related as a large family, men built wonderful temples, erected imposing statues, and even offered sacrifices to earn friendship or gain some favor.