A tariff is, quite simply, a tax levied by the government on imported goods. This forces the price of the good up and so makes it relatively expensive in the home market. This benefits the domestic industry as its product now appears relatively cheaper to home consumers. The home industry has, in effect, been 'protected' from the foreign competition.
It should be noted that the foreign firm could absorb the tax by reducing its price until the overall price (including the tariff) is the same as it was before the imposition on the tax. The firm is unlikely to be able to do this forever, though, and the tariff imposing country could always raise the tax again.
The diagram below shows the effect of introducing a tariff on a good in a previously unprotected market. This diagram is very popular with examiners for multiple-choice questions. It is important that you understand fully what is going on in this diagram.
The world supply curve is assumed to be horizontal (SW). The domestic supply curve above point G no longer exists given that the world price (PW) now dominates. The effective supply curve, therefore, is the line JGSW. The demand at price PW is OQ4, of which OQ1 is supplied domestically. This means that the rest is imported (Q4 − Q1). Notice that consumer surplus is represented by the large triangle ACPW and that producer surplus is represented by the much smaller triangle GJPW.
If the government now decides to protect the home industry be imposing a tariff on world imports, the world supply curve will shift up to SW+T and the new price will be PW+T. At this higher price, demand falls back to OQ3, of which OQ2 is supplied domestically (more than before). Imports, therefore, have now been reduced to Q3 − Q2.
The higher price has reduced consumer surplus from ACPW to ABPW+T. Some of this welfare loss has been transferred to other parties. The black shaded trapezium (PWPW+THG) is now extra producer surplus (or profit for the domestic producers). The green rectangle (BEFH) is now government revenue from the tax on imports (number of imports times the tax per unit). The two red triangles represent losses to society.
The first red triangle (FGH) represents the loss due to the fact the quantity between Q1 and Q2 used to be imported at a total cost in terms of resources used of FGQ1Q2 (number of units supplied times cost per unit), but is now produced domestically at a higher cost (HGQ1Q2). The upward sloping domestic supply curve shows that the cost per unit is rising for the domestic firms, whereas this cost per unit is constant for foreign producers.
The second red triangle (BCE) is simply the loss of consumer surplus due to the fact that consumers used to be able to buy the quantity between Q3 and Q4 at price PW and now they don't, because at the higher price the demand is only Q3.