Sheriff

A sheriff is generally a legal official with responsibility for a county or parish. The duties of a sheriff vary from country to country. The term comes from Anglo-Norman English. The kings officer in each shire was called a "shire-reeve". His function was to enforce the king's law in the shire or county. 
History.
The term shire reeve appears in documents in England in the early 11th century. When William the Conqueror conquered England in 1066, he kept most of the Anglo-Saxon sheriffs. When William abolished the great Anglo-Saxon Earldoms, the sheriff became the immediate representative of the king in the county. His appointment was typically for one year. He held court where he punished minor offenders. Later, his powers were reduced to arresting and imprisoning criminals. 
Colonial America.
When the American colonies began to grow, Britain established political control. As each colony established counties, a sheriff was appointed to keep law and order. He was also an officer of the British court. The sheriff had different titles in different colonies. In Rhode Island he was called a general sergeant. In Connecticut and Massachusetts the title was Marshal. In Plymouth Colony he was called a messenger. In the later colonial period, sheriffs were appointed by the colonial governor. They collected taxes, testified in court and served subpoenas. Because they were paid per task, and tax collecting paid the most, enforcing the law became a lower priority.
After the American Revolutionary War sheriffs were elected by the people.
17th and 18th century America.
In the American west, the Spanish were colonizing what would become Texas, California. The equivalent of the sheriff was called an Alguacil (sheriff/constable). As Americans moved west, they often started new communities. A sheriff was usually the only available law enforcement. Sheriffs had the power of "posse comitatus". That means a sheriff had the power to deputize anyone to help him keep the peace or go after and arrest criminals. A group of temporary deputies under the authority of a sheriff is called a posse. As America grew the posse was used less and less. Sheriffs are still the main law enforcement in rural areas. 
Modern sheriffs.
United States.
In many states the sheriff remains the highest ranking county law enforcement officer. Each state decides what powers the sheriff will have. In some states the sheriff is a court officer and law enforcement is left to the police. In other states they are charged with enforcing laws, investigate crimes, transport prisoners and operate jails. A sheriff can appoint deputies. A small sheriff's department might be run by a sheriff alone. A large sheriff's department could have hundreds of deputies and civilian employees. The main difference between a sheriff's office and a police department is that the sheriff usually operates correctional facilities and county civil functions.
Australia.
Sheriffs were appointed, as early as 1829 in Western Australia, as a court official. Duties included collecting taxes and fines.