Question One:
Half of the answer is that religion "came from the Stars." Not necessarily that it was extraterrestrial in nature, but that the mythologies were explanations of the movements of the stars. For example, Set was associated with immortality and Ursa Major, because a circumpolar constellation to the Egyptians, Ursa Major never set below the horizon (and so was "immortal"). The other answer, I believe is that... Gods exist, and they interact with us. I think this is part of it, and then philosophies concluding it throughout history as far back as Egypt.
Question Two:
Likely it occurred during the Upper Paleolithic Revolution, in which human consciousness greatly accelerated to the levels we now know - able the question, manipulate, and go against the laws of nature. IMO, the only reasonable conclusion is that some sort of deity must be responsible.