On a related note, if you want to know more about the power of sheriffs in the US, I strongly recommend this book-
The Highest Law in the Land: How the Unchecked Power of Sheriffs Threatens Democracy by Jessica Pishko
Huh? It is the opposite. It is the local enforcement and consideration that keeps the reckless federal encroachment from happening more often.
The elected office of sheriff, being a law enforcement office, can push back at the county level to overreaching state government, in a similar way to how state government through states' rights can push back against an encroaching federal government. It's a power of government that is closer to the people and more accountable to them, theoretically. Not to say it can't be abused but it can also serve a valuable role in checks and balances. Look up the principle of the Lesser Magistrate.