Imagine a world, different from ours. You are dropped there, all you know is that it can be dangerous. You have seen others killed, maimed, devoured, you are not sure what by. You hear a rustle in the grass. Is it the wind, or is it a dangerous predator. If you trust that it is just the wind, and you are mistaken, it could end very badly. If you steer away, just in case, you are safe, and nothing is lost. You find a broken body near a cave. Did he fall or is there something there that is dangerous? To survive, you must treat every snap, crackle, pop as a monster out to get you. If there are dangerous things in the shadows, there must be helpful ones too. Did you just find those fruit, or did someone, something leave them out for you? To try to understand and make the best of your surroundings, you try to find patterns in what happens.
Animals are also very good at recognizing patterns. That is how we teach them tricks. Every time I sit when he makes that sound, I get a treat, pattern! Not all patterns are on purpose, or even real, but we still like our patterns. Your cat shows up when you are opening a can, even if it is only peas.
Obeying your elders is natural, you have a better chance of survival. You teach your children that there are unknown forces out there, to hurt you or help you. Certain things you do put you in danger, so they become forbidden. Other things seem to bring beneficial outcomes, so they become compulsory.
At some point, someone speaks up and takes control of these rules. witch doctor, shaman, priest.
Unknown powerful forces, rules to make the best of them, a special class of person that tells you what to do or not do.