The Sheriff, who was usually a prominent landowner in the county (15 are mentioned in the Domesday Book of 1086, and only two do not own land) where he served, was an agent of the Crown with a wide-reaching set of responsibilities all effectively related to how central government interacts with its outer regions.
The origins of the role are in the Reeve, an Anglo-Saxon official empowered to hold court and try criminals. After 1066, every Shire in England was appointed a 'Shire Reeve' as part of William the Conqueror's tightening up of central government. This Shire Reeve, or Sheriff, was far more powerful than his predecessor and was partly modelled on the Norman vicomte and was head of government in the region - the King's viceroy, almost.
He was responsible for the law. He executing legal writs on behalf of the monarch, was able to set up a court called a 'tourn' to investigate cases, presided over the shire court (or moot) which tried offences against the crown or offences where two or more lords were involved, and had the authority to summon a 'posse comitatus' of able-bodied men to help restore public order. These posses were more useful in the Anglo-Saxon era, as the import of knightly tradition from Normandy
The Sheriff also supervised the Crown lands within his shire to a management level (ensure livestock is replenished, farm workers are well housed etc) and ensured that revenues from land's leased from the crown, port duties and fees for maintenance of local levies were delivered to the Exchequer (a role many relished, and Edward I's treasurer Walter Langton seized the lands of a number of Sheriffs over financial irregularities).
This role in particular would mark a significant step in direct taxation in England, and set the ground for flashpoints like the Baron's War as Sheriffs gained a reputation for oppressive taxation, which they often increased at will. Non-payment was met with seizure of lands - including church lands. There's even an account held by Rochester Cathedral of the Sheriff, Picot, stealing land from the church by claiming it belongs to the king, and then intimidating a jury into signing off on it in 1076:
The king ordered all men of the country to be assembled, so that it might be proved by their judgement whose the land ought to be. The men were assembled, and from fear of the sheriff affirmed, that the land was not [the church's] but the king's. Since the Bishop of Bayeux, who was presiding over the pleas, did not put much faith in them, he ordered them, if they knew that what they said was true, to choose twelve of their number to confirm on oath what they had all said. But they, when they had withdrawn for consultation, were terrified by a message from the sheriff, and swore what they had said was true.
Through the courts the Sheriff also had significant influence in what passed for democracy, and from the mid-13th Century they presided over the election of knights to parliament.
This was a significant whittling away of the power of the earls - who were vastly important in Anglo-Saxon England, to a Tywin Lannister degree - and the church, who no longer set at the heart of the county court. Personal power, though, varied by individual, influenced both by their proximity to the monarch and their relationship with local earls and bishops.
From 1236 onward there was a deliberate move away from landowning lords in the role to knights, and there were sporadic demands for the Sheriff to be an elected official (elected by the nobility, that is) instead of appointed by the Crown. Other roles also came into use which spread the power of the office more evenly, Escheators and Subescheators dealt with management of Crown property, and Coroners were appointed - often for life - to hold inquests and preside over courts.
Tax-collecting was passed onto specially appointed assessors and by the reign of Edward I (1272 to 1307) special commissions were formed of knights and nobles for specific one-off tasks such as the recruitment of knights or the hearing of a specific case, new types of courts emerged and the Royal Forests developed a specific system of administration too.
Don't worry though, there's still plenty of documented accounts of Sheriffs levelling arbitrary fines and perverting the course of justice right through the 13th and 14th Centuries.
Source: The Medieval English Sheriff to 1300 by William Alfred Morris, From Alfred the Great to Stephen by R. H. C. Davis, and Plantagenet England, 1225-1360 by Michael Prestwich