I think religion started out as a way to try to understand what was going on around us, like thousands of years ago, before most modern religions when there were gods for this and that. It makes sense that the sun was worshipped, and the moon, these things are alwasy there (well mostly) like they are looking on us and they bring life. Then things like wind and water were probably thought of as gods, or the work of gods, mainly because we had no other way to explain them. Then i reckon at some point people started taking advantage of these beliefs to form some kind of law or rule, for better or worse. Most of the 10 commandments are just common sense behaviour, good ways for people to act towards one another, but saying god said it kinda made sure people will stick to it.
i wonder more about how the idea of heaven came about, and all the different variations. whether it be sat at (a) god's side or val halla or nirvana or reincarnation. Some people, i think it's the native american church but i could be wrong, believe we are already in heaven. but i'm sure this has been discussed time and time again, i'm just ranting now, gotta fill my break somehow