Tameria, you have asked one enormous question! But the answer has to do with "How do any fables get started?"
At different periods in human history we have asked "Why this, why that?" We always crave answers. In the absence of a scientific evaluation, people in the past had to believe the accepted wisdom which was based on traditions handed down from earlier generations. Where though did any authority arise to answer questions?
In the earliest days of human societies we lived as hunter gatherers. We needed an explanation for life and death, day and night, why the sun shines so brightly after winter, and how to remember the names of the stars we saw in the night sky, for each bright star had a meaning and was associated with events on Earth. If the stars influence could be connected to an event or experience it would be a satisfying explanation. Looking up to the succession of constellations charging across the heavens, they were telling our forebears not only the activities of the gods but also confirming the time of year by the starry calendar. Everything then was imbued with a spiritual cast, to the early farmers and hunter gatherers there was no doubt that invisible agencies directed both the boons and the catastrophes.Humankind knew only too well the physical realities of birth, death, suffering and calamity and the unpredictable nature of existence. These were credited to the whimsical gods and later to YHVH, Micah 1;12 Micah 2:3. From this situation it is not hard to see how ritual and taboo began to appease the gods and avoid offending them.
As farming and pottery and settled life replaced the nomadic hunter life style, the old gods or spirit 'animal-masters' were dropped in favour of gods and goddesses who were also seen in the stars, but prominent were those which conferred fertility on the livestock and crops. The earliest writings ever are from people who were from this period (Late Neolithic /Early Bronze age). The earliest texts in the Bible reflect these new agricultural myths which were needed to reconcile the tyranny of fate as they saw it.
To counter the fragility of human experience the physical heavens were looked to to give comfort and certainty, for unlike Earthly things, the heavens were beautiful, enduring and predictable.
The most obvious things were the turning of day into night followed by sunrise in the morning, the setting and rising of the moon, the seasons and the accounts which were told from the pattern of stars of heaven. These gave rise to sagas which were originally told by travelling story tellers before the invention of writing. We can imagine one looking up at his prompt; the constellations of the night sky, to tell engrossing tales to a captivated audience. Later many were then written down and became the basis of many fables and sacred literature including the Bible.