It’s staggering to consider how much money nations are willing to pay and how much suffering they’re willing to endure to keep people from entering their borders. President Trump’s proposed border wall will cost anywhere from $12 billion (Trumps’ estimate) to $70 billion (Senate Democrats' estimate). In Europe, a region facing a migrant crisis of its own, several major investments in walls and fences have been made to stem the tide of migrant entry. Europe has now built and completed hundreds of miles of border walls, the equivalent of six Berlin walls, in the years since the actual Berlin wall fell. Our government is shut down in a stalemate over the issue, at the expense of millions of workers who are now locked out of their jobs with an uncertain paycheck. By any measure, preventing unwanted immigration is costly.

But there is a much simpler — and in the long-term far more effective — way to address this issue: create economic opportunity for the migrants, in their home countries. As jobs and opportunities become available within a country’s borders, people won’t need to endure what is often a life-threatening journey through an underground tunnel, above an over-ground wall, or across an ocean. And we already know how to do it.

Innovation plays a critical role in generating this opportunity. History has shown us, time and again, that a particular type of innovation — market-creating innovations — within a country’s borders can serve as a catalyst for sustained economic prosperity. When a company chooses to invest in products and services that are affordable and accessible to a large population of people, new markets for these products are created, enormous growth becomes possible, and immense opportunity is unleashed.

Consider postwar Japan in the 1950s. In the years after the end of World War II, Japan was desperately poor. The country experienced such a severe food shortage that food had to be rationed. But even in these dire circumstances, companies such as Sony and Toyota saw an opportunity for market-creating innovation to take root. They began making simple, affordable products that helped the average Japanese make progress in their lives. For every transistor radio or compact car manufactured, local Japanese jobs were created to assemble, distribute, service and sell the product into the newly created market. The key was not to create cheap products that could be shipped around the world, but rather it was simple and affordable products made in Japan, by Japanese, for Japanese, which would serve as fuel for economic growth in the decades ahead.

The same is true of South Korea just a few decades later. Amidst profound poverty, companies such as Samsung began making simple, affordable products such as table fans and televisions for local residents. Auto manufacturer Kia initially sold steel tubing and bicycle parts, before moving on to creating a market for affordable bicycles. Each of these products similarly created local jobs at every step of the value chain, which, in turn, began to create the fabric for growth throughout South Korea.

America’s own history contains a slew of market-creators that turned our country around. By almost any measure, America in the 1850s was more impoverished than present-day Angola, Mongolia or Sri Lanka. American society — with its well-developed institutions and infrastructures — looked nothing like it does today. But a steady stream of market-creating innovations after the Civil War began to not only create affordable and accessible products that could improve people’s lives, such as Isaac Merritt Singer’s sewing machine or Henry Ford’s Model T, but also created local jobs, helped finance roads and infrastructure, and laid the groundwork for other market-creating innovations to do the same.

And so when we are faced with the dilemma of trying to deter immigration, we already know a better way. What if we found ways to support companies, rather than walls? The potential impact may be far more enduring. Consider, for example, a promising market-creating innovation in Mexico.

Diabetes is the leading cause of death in Mexico, and the standard $1,000/year treatment for the disease is out of reach for most Mexicans, despite the fact that it claims more than 80,000 lives annually. But Clinicas del Azúcar has developed a simple and affordable solution for this problem, and has made itself an easy one-stop shop for all aspects of diabetes patient care, for just $250/year. By making diabetes care affordable and accessible, Clinicas has swiftly become the largest provider of diabetes care in Mexico in just a few years. In addition to the jobs and impact Clinicas is having — 60 percent reduction in diabetes-related complications, such as blindness, amputations and kidney failure — perhaps most impressive is that the company’s success has invited copy-cats. There are now several companies offering similar services for the treatment of diabetes in Mexico, and as a result amplifying Clinicas' original impact in job creation and health outcomes. And so, while on the surface, such an innovation may sound insignificant against the backdrop of a struggling economy, over time it will have enormous societal impact.

This is not to say that private companies will single-handedly save the world: the public and private sector each have critical roles to play in spurring and supporting growth. But in our research, it’s clear that investments in market-creating innovations typically precede prosperity, which ultimately reduces migration. The importance of innovation in igniting prosperity cannot be understated.

Instead of building walls, we should focus on building companies, and in turn, countries. We’d all be better off as a result.