SAN ANTONIO — In the weeks leading up to Thursday’s first debate of the 2016 presidential race, Republican candidates have sought to distinguish themselves from each other — and President Barack Obama — with ever-tougher positions on border security and illegal immigration, claiming current measures are failing.

And yet by many standards, the situation is not nearly as urgent as it was during last summer’s crisis and has improved steadily and markedly in some respects over the past decade or so — partly because of actions taken by the U.S. government, but also because of factors beyond Washington’s control.

Last year’s alarming surge of unaccompanied children and families arriving from Central America via Mexico has been cut by about half, according to U.S. Customs and Border Protection, a drop-off attributed in part to a crackdown by Mexico and better enforcement along the U.S. border.

Also, illegal immigration from Mexico has plunged dramatically since 2000, when Border Patrol agents arrested roughly 1.6 million Mexicans. Last year, agents stopped about 230,000.

In addition, since 2007, about 1 million Mexicans living illegally in this country have left, according to Marc Rosenblum, deputy director of the U.S. immigration policy program at the Migration Policy Institute in Washington.

Those trends have been attributed to a variety of factors, including the overall sluggish economy in the U.S., the decline in this country’s construction industry, and better opportunities in Mexico, according to a report by Rogelio Saenz, dean of the College of Public Policy at the University of Texas at San Antonio.

“The urgency is gone on the U.S.-Mexico border,” said Adam Isacson, border security analyst for the Washington Office on Latin America, a think tank.

During the spring and summer of 2014, the U.S.-Mexico border, particularly the 320-mile Rio Grande Valley section in Texas, became a major crossing point for tens of thousands of families and unaccompanied minors from Central America, many of them fleeing gang violence in Guatemala, El Salvador and Honduras.

Last year marked the first time arrivals from those Central American countries — some 468,000 altogether — outstripped migrants from Mexico.

The surge was treated as a national security issue. The Obama administration beefed up the Border Patrol in the Rio Grande Valley, while Texas deployed National Guardsmen and a large contingent of troopers.

The state has approved $800 million of spending on border security in the next two years alone.

Mexican officials, with support from the U.S., have stepped up apprehensions of migrants passing through that country.

The Obama administration also opened two secure family detention centers in Texas that together can house more than 2,000 women and children. Detention was envisioned in part as a way to discourage families from coming. It was an alternative to the usual practice of releasing families with notices to appear in court.

The detention policy has met with legal and political challenges from immigrant advocates. Homeland Security officials have said they are moving families through the facilities as quickly as possible, and more women are being fitted with electronic ankle bracelets as a condition of release.

Rosenblum said the spike in unaccompanied children and families was not really a failure of border security.