In other parts of the world the police's chiefs are selected by the city mayor or the city council, but in almost all counties of United States they are elected.
- Why are they elected, and not selected by the mayor?
- Has it always been this way?
A Sheriff in the US is also usually a county or city official, which are traditionally elected. There are exceptions, however, the Sheriff of New York City is directly appointed by the mayor.
The duties of the Sheriff are relatively static, and usually uncoupled from the efforts of appointed law enforcement officials. There's no real reason why a Sheriff would need to be appointed to be more effective in his or her office (in most places), so it remains an elected office allowing for the people to determine if a changing of the guard might be in order.
Depending on the location, the duties of a Sheriff might be almost or completely ceremonial, for which term elections would make sense.
The Sheriff is elected by the people in the county to be a check and balance against the other two branches of government, to be the first line of defense that the people have against bad laws. The courts have upheld this from the beginning. In fact, some states, like Delaware, have gotten rid of the check authority of the Sheriff because the legislature found such a check against its power to be inconvenient. This is also why many state Constitutions mandate a Sheriff, to sustain the tripartite system through checks and balances against unconstitutional legislation. This is what Madison prescribed to sustain a free state.
For an example of checks and balances, see Los Angeles where local sheriffs refused to enforce the recent mask mandate in any way. The only recourse county officials have is to initiate a recall/impeachment, triggering a new election that might elect someone who's more in line with what the local government wants to do. But they cannot compel the sheriff to act in a certain manner.
To see why Sheriffs are elected you need to understand the power of the sheriff and why it is necessary for them to represent the people directly and not be just an extension of the governments power.
This webpage explains this relationship. If sheriffs are appointed they just become another arm of an already oppressive "Big Government". The Sheriff is part of the peoples protection against over reaching political power.
Jim Isbell, Candidate for San Patricio County TX Sheriff.