The image of a father and his two-year-old daughter, their corpses face down in the mud on the banks of the Rio Grande, illustrates one part of the crisis on the southern border of the United States. The nightmarish conditions for migrants, with many held in severely overcrowded U.S. detention facilities, are another chapter. And then there’s how the U.S. Congress, paralyzed by distrust between Democrats and Republicans, waited until last week to vote additional funding aimed at improving life in those holding pens.

But the most revealing thing about the migration issue, and its solution, are the words of Nayib Bukele, the President of El Salvador.

On Monday, the same day funerals were held for Oscar Alberto Ramirez and his daughter Valeria, Salvadorans who drowned while trying to ford the river that marks the border into the promised land, Mr. Bukele was asked about the reason for the tragedy.

Story continues below advertisement

“People don’t flee their homes because they want to,” he said in English. “People flee their homes because they feel they have to. Why? Because they don’t have a job, because they are being threatened by gangs, because they don’t have basic things like water, education, health.

"We can spit blame to any other country but what about our blame? I mean, what country did they flee? Did they flee the United States? They fled El Salvador. They fled our country. It is our fault.”

And also: “If people have an opportunity of a decent job, a decent education, a decent health-care system and security, I know forced migration will be reduced to zero.”

That’s the issue, in a nutshell. Problem and solution.

If President Donald Trump was serious about fixing the crisis on his country’s southern border, instead of playing it for political advantage, he’d be listening to Mr. Bukele.

The people of El Salvador are hardly to blame for what has happened to their homeland. The Central American country and neighbouring Honduras and Guatemala are corrupt, economically depressed and violent. In 2016, El Salvador had the world’s highest murder rate. Honduras was second. It’s why so many feel they have no choice but to leave.

In May, U.S. authorities took more than 144,000 migrants into custody at the southern border. That means more people crossed from Mexico to the United States in one month than have crossed into Canada at the Roxham Road unofficial crossing point in three years. The vast majority crossing the U.S.-Mexico border did so between official posts, as Mr. Ramirez and his daughter attempted to do. Most came to make a refugee claim.

Story continues below advertisement

The flow of migrants entering the United States in May was roughly three times as high as it was during the Obama administration. The surge is driven by people from the so-called Northern Triangle of El Salvador, Honduras and Guatemala. As Mr. Bukele correctly described it, misery spurs migration.

But El Salvador is not doomed to forever be a land of misery. Consider that nearby Costa Rica has long been peaceful, democratic and relatively prosperous. And Panama, a dictatorship just a generation ago, has made big strides and is now level with Costa Rica. The United Nations Human Development Index ranks both countries ahead of Brazil, Mexico, China and nearly all of Latin America and the Caribbean. El Salvador is far behind. But change is always possible.

In 2018, Mr. Trump famously said he wanted fewer immigrants from “shithole countries.” To put it in words Mr. Trump can understand, the way to stop people from fleeing crappy countries is to make them less, you know, crappy.

Mr. Bukele, the son of Palestinian immigrants, has a dream of turning El Salvador into a place that draws investment and people, rather than chasing them away. It’s part of the reason why he said what he said about his country’s responsibility for migration. He wants and needs Washington’s help.

If the United States were serious about stemming the flow of migrants, it would be crafting a Marshall Plan for Central America. It would be helping the Northern Triangle achieve better government and more development and investment.

Instead, Mr. Trump earlier this year announced that, as punishment for sending so many migrants, he would cut aid to the Northern Triangle. His administration quietly backed away from the pledge, but the message has been sent. Enlightened self-interest is not on this President’s menu.