When does an import tariff raise welfare for the Home country, and why? What is the effect of a tariff worldwide on welfare, and why?

When does an import tariff raise welfare for the Home country, and why? What is the effect of a tariff worldwide on welfare, and why?