This collection then formed the basis of The Thousand and One Nights. Then, in Iraq in the 9th or 10th century, this original core had Arab stories added to it—among them some tales about the Caliph Harun al-Rashid.
Also, perhaps from the 10th century onwards, previously independent sagas and story cycles were added to the compilation [...] Then, from the 13th century onwards, a further layer of stories was added in Syria and Egypt, many of these showing a preoccupation with sex, magic or low life.
He noted that the Sassanid kings of Iran enjoyed "evening tales and fables".
Al-Nadim then writes about the Persian Hezār Afsān, explaining the frame story it employs: a bloodthirsty king kills off a succession of wives after their wedding night; finally one concubine had the intelligence to save herself by telling him a story every evening, leaving each tale unfinished until the next night so that the king would delay her execution.
It is possible that the influence of the Panchatantra is via a Sanskrit adaptation called the Tantropakhyana.