The origin
A Religion is an organisation. Before there were Religions there were informal practices based on spirituality. Atheists claim that Man invented Gods to explain the forces of Nature, but that is nonsence. Man is not that curious. Man seeks to learn how the survive in a dangerous world - not to understand it Early Man had strange experiences due to hallucinogenic plants and diseaseand so came to beleive that a spirit world existed and that it was important to negotiate woith it to survive and so the tribal Shaman started this profession to advise others on such matters.
With the development of Civilization this practice came to be very Professionalised and thus the first Religions were born.
So with a writren history etc these Religions acquired doctrines etc and typically insisted that they were the only one. Some Religions adopted interesting Gods from other Religions and others denounced rival Gods as demonic to be rejected. But most of the knowledge about this development is lost in the mists of time. Keith