It helps to have a sheriff on the same side as the people.
It was, but a lot of it had to do with the fact that we didn’t have all that many nuts in the West who figured, “hey, I need to kill a bunch of little boys and girls before blasting my mashed potatoes (a.k.a. my brain matter) out the other side of my head.” A lot of the actual “violent crime” involved holdups where a person held up someone else with a gun, and the person gave them the money, and the outlaw ran off with it. Most people figured letting the outlaw off was a better idea than risking really getting shot and killed. Putting up a full fight was also stupid because a whole populated town would open fire on you. We didn’t have quite the dense city populations that we have today, those are way different.