The OC of a pie is 2 programs for Jennifer. So Robert has a comparative advantage in pies and Jennifer has a comparative advantage in programs . Fig 1shows that the production opportunities for Robert and Jennifer can be represented by downward sloping straight lines. As long as these are straight lines, the individuals should specialize in the good in which they have a comparative advantage and trade that good with the other individual. So in this example, Robert should produce pies and Jennifer should produce computers and they should trade.
Same principle applies to domestic and international trade.
When there are only two parties involved in trade - barter is possible. Trade with multiple parties usually require the use of a medium of exchange like money. The PPF gives all combinations of all goods and services that an economy can produce with its resources and technology. Suppose an economy can produce only computers and shoes. Then all possible combinations of these two goods lie on the PPF, given the country's resources and technology.