Essentially, religion is a code of conduct for a civil society. It all started from here. With society’s progression, the code of conduct also evolved resulting in its expansion and formalization.
Later all aspects of human cultures, including presumptions and myths, and overwhelming elements of nature were covered in one order. In all these developments social unity and coherence were the natural needs and dependencies of an advancing society.
An organized collection of beliefs and behaviors, a set of ideas started pouring in this social construction. And with the introduction of the Supreme Being, man’s most intuitive conception or imagery, the assemblage got sanctified.
(Excerpts from Hinduism Beyond Rituals, Customs, And Traditions)