What factors have influenced the evolution of religious beliefs throughout history?