The Sheriffs of the City of London

History
The title of Sheriff, or 'shire reeve', evolved during the Anglo-Saxon period of English history. The reeve was the representative of the King in a city, town or shire, responsible for collecting taxes and enforcing the law.  By the time of the Norman Conquest in 1066, the City of London had sheriffs, usually two at a time. The Sheriffs were the most important City officials and collected London's annual taxes on behalf of the Royal Exchequer; they also had judicial duties in the City's law courts.

Until c.1130, the Sheriffs were directly appointed by the King.  London gained a degree of self-government by a charter granted by Henry I, including the right to choose its own sheriff, a right which was affirmed in an 1141 charter by King Stephen.  This also included jurisdiction over the neighbouring county of Middlesex.

In 1189, an annually elected mayor was introduced as chief magistrate for the City of London (along the lines of some European cities of the time such as Rouen and Liege); this change was reaffirmed by a charter granted by King John in 1215. As such, the Sheriffs were relegated to a less senior role in the running of the City, and became subordinate to the mayor. The mayor (later Lord Mayor of the City of London) generally served as sheriff before becoming mayor and in 1385 the Common Council of London stipulated that every future Lord Mayor should "have previously been Sheriff so that he may be tried as to his governance and bounty before he attains to the Estate of Mayoralty"; this tradition continues to this day. 

Modern times
Two Sheriffs are elected annually for the City of London by the Liverymen of the City Livery Companies.  There is one Aldermanic Sheriff (ie a Sheriff who is an Alderman) and one Lay Sheriff.  They attend every session of the Central Criminal Court as well as meetings of the Court of Aldermen and Common Council.

The Sheriffs live in the court house complex during their year of service, so that one of them can always be attendant on the judges. In Court No 1 the principal chairs on the bench are reserved for their and the Lord Mayor's use, with the Sword of the City hanging behind the bench.

By a "custom of immemorial usage in the City", the two Sheriffs are elected at the Midsummer Common Hall by acclamation, unless a ballot is demanded from the floor, which takes place within fourteen days. The returning officers at the Common Hall are the Recorder of London (senior Judge of the 'Old Bailey') and the outgoing Sheriffs.
 
Today the Sheriffs' jurisdiction covers only the square mile of the City of London