Answer = because Yahweh is a mythological invention inherently from "men" a lone.
Men envisioned and composed their god(s) to the way they wanted and appealed to their understanding of occurring events on earth, as well to create a desirable relationship with these/their envisioned god(s).
Mind you humanity in ancient times didn't have the informational background knowledge of how and why things occurred to themselves or what they visual saw and witnessed.
Those men witnessed enduring perilous things in their living experience, including their own eventual and foreseeable death, so (their) gods were a consoling and appealing answer for help, since in the acceptance and understanding the gods were actively controlling what was happening to them..