"It's sometimes useful for non-Americans to think of the U.S. like a federation of weak semi-autonomous countries."
That would be helpful if it would be true. In old' Europe a the equivalent of a county or city does not have any power to enact and enforce legislation, all the laws are country-wide and enforced by the national police; the only local law enforcement is for parking and minor (no criminal record) misdemeanors.
From what I know many counties in US have the power to regulate areas that can be felonies if disobeyed (like gun regulations), something like that is unbelievable around here.