The imposition of tariffs and introduction of quotas makes goods that are imported more expensive and limits the total amount of any good that can be imported.
For the domestic government it provides a way to boost production by local industries which increases their revenue and prevents them from laying off people. This decreases unemployment, increases income and ultimately improves the image of a government which in a democracy is a definite advantage to the ruling government in the subsequent elections.
Foreign producers are adversely impacted by tariffs as their goods become costlier which reduces the number of goods they can sell. Quotas also restrict the total number of products that they can sell in the country.
Domestic producers are benefited by tariffs as they can compete with imported products as the difference in price is reduced. Quotas ensure that after a certain quantity of goods have been imported, the domestic producers no longer have to face competition from imported goods.