The fifth graders looked up as I placed a gift on each of their desks. Each student randomly received a small item, such as candy, a box of crayons, a magic trick, or a comic book.

After giving each child a gift, I told the students they could each trade—if they chose—with the person seated to their left or right. Several made trades; some didn’t. Next I told them they were free to walk around the room and exchange their gifts. In a moment the room was filled with excited kids making trades.

When they had sat down, I asked them how many traded. Nearly all had. How many felt they were better off after their trade? I asked. They all did.

I was trying to teach these fifth graders a little bit of the magic of trade—how it allows us to improve our lives while improving the lives of others. As long as the people trading do so voluntarily, trade is always a win-win proposition.

But trade is far more magical than this. In the fifth-grade class, all the things being traded were simply handed out, free. Nothing had to be produced. In the real world things must be produced, meaning people must spend time, effort, and other resources producing them.

This is where we find trade’s real magic: It directs people into areas of work and production where they can make the most at the lowest cost. That increases the total amount of wealth for everyone.

Think of it this way: If you live in a warm sunny climate, such as Florida’s, you can grow oranges fairly easily. If you live in the North, you can grow wheat fairly easily. If you want to grow oranges in the North, you will need a greenhouse (at least). All the resources you use to grow a single orange could have been used to grow acres and acres of wheat. In other words, your “opportunity cost” of growing oranges is very high. In the South, to grow wheat would be equally costly.

When we are free to trade, we are free to figure out the things we can produce at the lowest opportunity cost. This is David Ricardo’s law of comparative advantage. It indicates that trade opportunities will exist between people and groups even when one side is absolutely more efficient at everything than the other side. (A $500-an-hour lawyer who is also an excellent typist will nevertheless hire a $10-an-hour typist because every hour the lawyer spends typing is an hour in which he could have made far more money lawyering.)

The larger our scope of trade, the more we can benefit from the productive gifts and abilities of others. Free trade between North and South will result in the South producing oranges and the North producing wheat with plenty of both to go around. If people were not free to trade, either the North would have no oranges and the South no wheat, or they would have a lot less of both.

In short, generating wealth requires productive resources, such as labor, capital, and land. Free trade promotes the discovery of the best uses of scarce productive resources to make the most goods and services.

Despite its clear advantages, free trade is always under attack by those who would directly benefit from its restriction. Currently, the Obama administration is trying hard to promote “clean energy,” such as wind and solar power, in the United States. Those industries are receiving big subsidies and are asking for more. At the same time, ironically, the administration is slapping tariffs on Chinese solar cells and wind towers, saying they unfairly benefit from Chinese government subsidies. Domestic solar and wind-tower companies say they cannot compete with the Chinese producers, who are able to sell their products at a lower cost.

It’s obvious these tariffs will harm consumers by cutting supply and increasing domestic costs. They also harm U.S. exporters, because trade is a two-way street: For the Chinese to buy American goods, they need American dollars. Fewer imports mean fewer exports. And tariffs harm everyone else by preventing productive resources from finding their highest-return, lowest-cost uses.

Free trade truly is needed for an economy to grow and prosper. According to the 2012 Index of Economic Freedom published by the Heritage Foundation and The Wall Street Journal, countries with the most trade freedom (such as Hong Kong, Switzerland, and Canada) have higher per capita GDPs, lower incidences of hunger, lower rates of unemployment, and cleaner environments than countries at the bottom of the trade freedom scale, such as North Korea, Bangladesh, and Zimbabwe. And countries that tried for decades to be self-sufficient, such as India, paid a heavy price in stagnant growth and poverty.

What’s more, free trade among nations is a way to promote peaceful international relations. When individuals are free to trade across political boundaries, they are more likely to view “foreigners” positively. The mutual benefits of trade, in other words, can promote peace.

Ricardo, one of the most influential economists of all time, was among the first to understand the great value of free trade. In his Principles of Political Economy and Taxation (1817) he summed up the benefits of free international trade nicely:

Under a system of perfectly free commerce, each country naturally devotes its capital and labor to such employments as are most beneficial to each. This pursuit of individual advantage is admirably connected with the universal good of the whole. . . . [It] distributes labor most effectively and most economically; while, by increasing the general mass of productions, it diffuses general benefit, and binds together, by one common tie of interest and intercourse, the universal society of nations throughout the civilized world.

Free trade gets a bad rap from domestic producers and protectionists of all sorts. But nothing is more important to a growing, dynamic economy than allowing the basic human right to freely and peacefully exchange with others.