Fairs began as a place of fellowship, exhibition and trade
Ever since the invention of oxen and carts, or boats capable of carrying goods, market places have sprung up at agreed-upon places and agreed-upon times. Fairs were temporary things of a few days, and had to deal with bad roads and bandits along the way. They could operate only under the protection of a strong war lord or Count. (Indeed, that is where the word 'county' comes from). And the Count would extract a fair 'fee' from the participants for his protection. Fairs differed from carnivals and markets in that there was a major emphasis on exhibition and fellowship, as well as trade. Carnivals were more apt to be theme 'entertainment'. Many towns grew around the places where at first there were only periodic Fairs, Carnivals or markets.
Agricultural Fairs specialized in agricultural products and needs, and there were only a few times during a year when a farmer was free enough from the demands of keeping livestock, or tending fields, to make the difficult trip along rustic tracks to a distant Fair. People in the business of buying what the farms produced (and those selling to farmers what they needed) would try to attend many Fairs, and brought with them enough comforts to entertain themselves and others to make attending the Fairs both fun as well as profitable. Impromptu athletic contests and races would evolve into an evening of singing and dancing.
At the turn of the century, a County would typically divide its agricultural areas into local regions of no more than 12 or 15 miles in diameter, which was about the distance a farmer could travel in a day over the roads of the times to bring his produce. And so originally there were many little Township Fairs. The Province of Ontario still has some 233 local Fairs run by local Agricultural Societies.