Sanctuary Cities were actually founded for safety reasons. Here is a general idea.
In many cities with illegal immigrants these laws are designed to allow illegal immigrants to speak with the police without fear or reprisals. The idea is that they can report crimes and be witnesses without fear of being deported.
Now, if you commit a felony (which, for non-Americans information, are almost all serious crimes) you go to jail. And, if the Federal Agents ask a state or jail for a specific prisoner, they are handed over and deported. BUT, if you commit a misdemeanor (like traffic violations or jay-walking or - most importantly- being here illegally) you don't get turned over for deportation. It allows Police to work with the communities to provide safety for all citizens and immigrants.
Trump is trying to change this in two ways.
First, his order makes it so that anyone CHARGED with any crime - even those without a trail yet or those that were found innocent - must be turned over to be deported. And, since being here illegally is a crime, that is everyone.
Second, the Feds don't have enough man power to check everyone and so they want the local police to run a citizenship check on everyone and automatically turn over anyone who is here illegally. The Police, overworked and stretched, say that doing background checks on every person that is ever charged with anything anytime AND all witnesses that contact the departments is not the best use of their resources. Note that some border areas already do check criminals (although not witnesses) because it IS worth their time.
Sanctuary Cities are NOT doing it to keep immigrants in and the Feds out, they are doing it to keep their citizens safe. In almost every Sanctuary City, the Police are behind the implementation.
And now you know.