If you refer to Exodus the question has no answer. Like all myths it is set of stories, some based on historical events, some taken from other cultures, woven together to tell a story of the movement of the Jewish people into Palestine.When did the myth take hold?