Is your only answer "Just because"?
That's way off topic, but my answer is "I don't know".
It has something to do with stars exploding, scattering heavier elements about, and they accrete into disks, and form planets. It goes on even today.
Not exactly satisfying, but the answer that "I don't know, therefore God did it" is even more ridiculous.
It's understandable for a primitive man who sees a lightning strike start a fire and wonders about it. "I can't do that", he thinks. "Nobody in my tribe can do that". "I haven't seen any other tribe that can do that".
Humans being hungry for explanations, he ascribes it to a "god" that he can't see and invents reasons for this god to do such things. It sounds loud and looks fierce, so he imagines anger is the reason and himself as the culprit and starts imagining ways to assuage this anger.
All very reasonable, for humans 10,000 years ago.
But at some point, the real explanation for lightning and thunder comes out, and the idea of an angry god with a plan just seems silly.