Kurdish-led fighters have long guarded facilities holding Islamic State detainees or their families, after the caliphate the group tried to establish was defeated in 2019.