A county is a geographical region of a country used for administrative or other purposes, in certain modern nations. The term is derived from the Old French conté or cunté denoting a jurisdiction under the sovereignty of a count (earl) or a viscount. The modern French is comté, and its equivalents in other languages are contea, contado, comtat, condado, Grafschaft, graafschap, Gau, etc. (cf. conte, comte, conde, Graf).
When the Normans conquered England, they brought the term with them. The Saxons had already established the districts that became the historic counties of England, calling them shires (many county names derive from the name of the county town (county seat) with the word "shire" added on: for example, Gloucestershire and Worcestershire).
The Vikings introduced the term earl (from Old Norse, jarl) to the British Isles. Thus, the Anglo-Saxon's "earl" and "earldom" were taken as equivalent to the continental use of "count" and "county" under the conquering Normans, and over time the two blended and became equivalent terms. Further, the later-imported term became a synonym for the native English word scir ([ʃiːr]) or, in Modern English, shire. Since a shire was an administrative division of the kingdom, the term "county" evolved to designate an administrative division of states (federal states like those of Germany and the United States) or of a national government in most other modern uses.
In the United States and Canada, founded on the British traditions 700 years later counties are usually an administrative division set by convenient geographical demarcations, which in governance have certain officeholders (e.g. Sheriffs and their departments) as a part of the state/province mechanisms, including geographically common court systems.