The work was collected over many centuries by various authors, translators, and scholars across West, Central and South Asia, and North Africa. Some tales themselves trace their roots back to ancient and medieval Arabic, Egyptian, Indian, Persian, and Mesopotamian folklore and literature. In particular, many tales were originally folk stories from the Abbasid and Mamluk eras, while others, especially the frame story, are most probably drawn from the Pahlavi Persian work "Hezār Afsān" (, lit. "A Thousand Tales"), which in turn relied partly on Indian elements.