One of the most argued-over words in modern politics started life as a word for telling people things.
Etymonline traces tariff to the Arabic ta'rif, a noun from the verb 'arafa, "he made known." It glosses ta'rif as "information, notification, a making known," and also "inventory of fees to be paid." The Oxford English Dictionary, quoted on the Language Log blog, adds "explanation, definition."
The word reached English through the trading ports of the medieval Mediterranean. Etymonline gives the steps: Medieval Latin tarifa, a list of prices or rate book, then Italian tariffa, "price, assessment." Language Log notes the Spanish cognate tarifa.
When English took it up in the 1590s, a tariff was a table. Etymonline's first sense is "arithmetical table." The OED, via Language Log, quotes Florio's Italian dictionary, which glossed the word as "arithmetike or casting of accounts." The official list of customs duties appears in English by 1592. Later the word moved from the list to the duties, and then to the laws that set them.
The Tarifa story
A popular explanation points to Tarifa, a town on the Strait of Gibraltar. In this version, pirates or local strongmen based there charged passing ships a fee, and sailors called it a "tariff." A 2015 column in South Africa's Engineering News tells it as fact, crediting a gang of racketeers based in the town, but cites no source.
The dictionaries do not support it. Neither Etymonline nor the OED entry quoted by Language Log mentions the town. Both derive the word from ta'rif.
The town's name has a separate origin. According to Wikipedia, Tarifa is named after Tarif ibn Malik, an Umayyad military commander, and took the name after his conquest in 710. That makes Tarifa a personal name. The resemblance between the two words is real, and both come from Arabic, but one is a man and the other is a notice.
The true history has its own irony. A word for information, carried into Europe by Mediterranean trade, became the standard name for a tax that restricts trade.