If we presume that the story of Moses is true, I suppose we can postulate that religion as a political force and as a communal power was mostly derived from the rebellion of a people against older systems of political or tribal thought, with ideas being the capitulating force in convictions to religion.
Moses who was raised by the Egyptian hierarchs, managed to distinguish, through inquiry, the relationship between the politics of slavery and the politics of power. Through this understanding and a couple of well-thought convictions, and the understanding of his identity in relation to what natural or tribal law may have delivered him unto, manifested itself in resentment for the natural or tribal laws that guided the roles of each person in that civilization. Reason and human understanding, then, as David Hume discussed, would be the explanation for theories "as a matter of fact," mostly found in religious scripture.
Moses managed to profess his truth through speech, and created a mass of people readily willing to follow his new-found spirituality, or idea. I suppose religion is a political force of newer ideologies and ideas, though old now, newer to the natural laws that guided the power or political ideology of our earliest civilizations.