The do this under the "Status Quo" part of the divorce or separation laws. Which say children have to remain in the same status quo as they were in before a couple separated.
What Makes The Hasidic Community Choose Tribe Over Offspring? ? The Forward
https://www.haaretz.com/us-news/.premium-1.818767
One Of Us Ex-Hasidic Woman Abusive Husband Sad Story
Cults like Hasidic Jews use this to make sure children are brought up ignorant of the modern world, unable to get a job outside the Community and form friendships outside the community. Therefore imprisoning them inside the community. US law has to change to makes sure every child gets a standard education.
That will break the hold of the Mormons, Moonies, Scientologists, Hasidic Jews and every other religion like Islam where the children are educated in faith schools.