Trump's Mexican pivot: It's about jobs and votes

Donald Trump's surprise visit south of the border Wednesday — apparently to mend fences after a campaign laced with anti-Mexican rhetoric — surprised many observers in both countries.

But a closer look at the state electoral vote map helps explain the Republican presidential nominee's sudden interest in Mexico. The states he needs to win rely heavily on Mexico as a customer for exported goods. And they have large blocs of Hispanic voters.

Until recently, Trump has made his anti-immigration stance one of the cornerstones of his campaign. He has blamed Mexico for the loss of American jobs, and promised to renegotiate or scrap the 1994 North American Free Trade Agreement trade deal between the United States, Mexico and Canada.

In a brief joint news conference after meeting with Mexican President Enrique Pena Nieto, Trump repeated his objections to the trade deal.

"I shared my strong view that NAFTA has been far better for Mexico than the U.S.," he said. "It must be improved upon so workers in both countries benefit from fair and reciprocal trade."

With just 10 weeks to go until the election, Trump trails Democratic rival Hillary Clinton in most opinion polls nationally.

Now, Trump seems to have had a change of heart about America's second-biggest trading partner. Intentionally or not, his trip Wednesday highlights the importance of the Mexican economy to the U.S. and of Hispanic voters in key states he needs to win.

Overall, Mexico is the second-largest customer for American exports of goods — everything from cars and trucks to computers and machinery.

But Mexico is a much more important customer for some U.S. states than others.

New Mexico, for example, sent 45 percent of the state's exports to Mexico last year. Other big exporters include border states like Arizona, Texas and California.

States that count Mexico as a big customer also offer presidential candidates a large share of electoral votes. The top 25 states with the biggest reliance on exports to Mexico represent 330 electoral votes, or some 60 percent of the total.

Of those, 13 are either leaning Republican or solidly in the GOP column; 10 are likely or leaning Democratic, and two are toss-ups, according to NBC.

His surprise Mexican visit was also staged to drum up attention for a major speech on immigration, an issue that has stoked passions among his supporters, but alienated many Hispanic voters.

The electoral math also helps explain why Trump may be softening his anti-immigrant rhetoric, In recent weeks he has backed away from an initial campaign pledge to undertake a mass deportation of some 11 million undocumented immigrants in the U.S.

That pledge, along with his promise to build a giant wall along the U.S. Mexican border, has not helped him win support with the more than 25 million Hispanics among eligible U.S. voters — or roughly 11 percent of all eligible voters, according data from the Pew Research Center

And those are voters Trump needs to win over if he has a chance at getting elected.

Among top 25 states with the largest shared of Hispanics among eligible voters, 15 are either solidly Democratic or leaning that way. Two are toss-ups, and the remaining eight are either solidly Republican or leaning that way, according to NBC News.