Clearly Explain and Discuss the Theory of Comparative Advantage. Given the Economic Benefits of Trade (According to the Above Theory) Why Do Some Countries (Give Examples) Attempt to Restrict Trade?

Clearly explain and discuss the theory of comparative advantage.   Given the economic benefits of trade (according to the above theory) why do some countries (give examples) attempt to restrict trade?
Throughout the following essay I am going to be explaining and discussing in detail the theory of Comparative Advantage.   The theory of Comparative Advantage is one the most fundamental and unchallenged laws in economics with many benefits to the economy, and will be basing the core of the essay on this law.   The theory of Comparative Advantage was initially put forward in 1817 by David Ricardo which was published in Principles of Political Economy and Taxation.   Examples will be used throughout the piece in order to back up the theory and to provide depth to the piece while I put forward arguments as to why some countries restrict trade despite the economic benefits to trade.  
Comparative advantage is the ability of country to produce a specific good or service at a lower opportunity cost than another country and producing most efficiently.   It is said that the country has an advantage over another country at producing that good.   So a country should produce and export the product in which they have a smaller absolute disadvantage, and import the other product which they have a greater absolute disadvantage over.   To illustrate this I will be referring to an example originally used by David Ricardo regarding the production of cloth and wine from England and Portugal.   In Portugal it is easy to produce both wine and cloth, whereas in England it is difficult to produce wine but relatively easy to produce cloth.   Portugal is able to produce wine using smaller amounts of labour compared to England.   So it would be mutually beneficial if Portugal produced wine in excess and England produced cloth.   As a result Portugal could trade the wine for the cloth produced in England. Both countries are better off as they both have the products; England has cloth but also has...