During the Napoleonic Wars 1799-1815 Britain could not import large amounts of grain from Europe. That all changed in 1815. British landowners feared that cheap foreign grain would be imported so they passed the Corn Laws.
Import duties would be charged on imported wheat unless the average price of British wheat reached £4 a quarter and unless the price of British barley reached £2 a quarter. However from 1828 a sliding scale was used. Import duties were gradually increased as the price of British grain fell.
In 1839 John Bright and Richard Cobden formed an Anti-Corn Law League. Prime Minister Peel finally abolished the corn laws in 1846. (Robert Peel lived from 1788 to 1850. He was prime minister in 1834-35 and 1841-46).
Meanwhile by the 1840s public opinion changed in favor of free trade. Most people believed that government should interfere in the economy as little as possible. They also believed that countries should trade without import duties. So in the early 1840s Peel abolished many tariffs.