A bunch of dudes realized they could gain power, land, wealth, and sexual access by peddling fairy tales to the masses. Not surprising that this happened many times, in many places, over the early historic record, primarily at population centers located relatively close to the river deltas that gave rise to the first cities. You know, just human shit. Same as it ever was.