What exactly is the meaning and definition of a tariff?

Tariffs are levies on imports, exports, and transit to a third country. They're meant to raise state cash, preserve domestic business, or advance politics, but they can backfire.

What exactly is the meaning and definition of a tariff?
Can you explain what a tariff is and why it exists? Image by Jarosław Bialik from Pixabay