The terms absolute advantage and comparative advantage are used when trade between two countries is being considered. If one of them has the ability to produce all the goods which are being considered for trade at a lesser cost, it is referred to as absolute advantage. A lesser cost implies the use of a lesser quantity of all resources.
Even if one country has an absolute advantage in all products that can be traded. it does not rule out trade between them in a rational world. This is due to what is called comparative advantage.
To better understand the concept of comparative advantage let us consider an example of two products A and B and two countries C1 and C2 between which A and B can be traded.
If C1 is capable of producing A as well as B at a lesser cost than C2 it would seem pointless for C1 to buy anything from C2. Now let us assume that with the resources C1 has it can produce 10 items of A and 20 items of B. On the other hand C2 can produce with the resources it has 8 items of A and 10 items of B. We see that for each of A that C1 produces it has to sacrifice producing 2 of B, while for each of A that C2 produces it sacrifices producing only 1.25 of B. This gives C2 a comparative advantage over C1 in producing A. To maximize the total production C2 should only produce A and C1 should only produce B. The extra quantities that each of them produce can be traded between them.
This shows how trade between C1 and C2 is possible in spite of the fact that C1 can produce both of A and B at a lower cost than C2.
Comparative advantage explains the trade between nations even where one of the nations can produce all products that can be traded at a lower absolute cost than the other nations.
Absolute advantage is the term used for the situation in which one country can make a product using fewer resources than other countries. By contrast, a country has a comparative advantage if its opportunity cost for making a product is lower than that of other countries. Comparative advantage can tell a country what it should produce whereas absolute advantage cannot.
Whenever a country (or a person or a firm or anything) decides to produce one thing, they give up the possibility of producing something else using those same resources. If you use a certain amount of labor and steel to make a tank, you can't use it to make a car. This is opportunity cost.
A country should make the things that it can make at the lowest opportunity cost. If its opportunity costs for making something are lower that those of other countries, it has a comparative advantage in making those products.
Please follow the amosweb.com link for an example of these concepts using numbers that can help to illustrate the differences.