Local police have to be careful about how long they hold illegals in their jails, because it isn’t legal for them to hold people longer than a certain amount of time.
Some police departments don’t cooperate with ICE because it erodes trust with the people they serve, which makes their main job, local policing, more difficult.