He sighed. “But people are eating it up,’’ he said. “I can’t believe it.”

Mr. Estrada, who is 73, knows better than most that borders are more than lines on a map. Born in Mexico, he arrived in America at the age of 1. Until the 1970s, he said, the border had an organic quality. During the Cinco de Mayo fiesta, dancers paraded from Mexico into America then back again; beauty queens from both countries sat together on a platform that straddled the border; white tourists crossed into Mexico for the bullfights, the night life and the “rum runs” — cheap alcohol.

Then the drug wars exploded, and in 1995, a fence started to rise. Crime fell sharply, but the drop exacted a cost. Tourism withered, the curio shops closed and there was a painful tear in the cross-border culture. “The dynamic changed,” he said.

The sheriff’s nostalgia pointed to a wider truth: Walls are not just about whom a country wants to keep out; they are a mark of what it is trying to preserve, its idea of itself. With the rise of Mr. Trump, America’s sense of itself is suddenly less sure. And so I spent a week in the southern borderlands, flitting between Mexico and America, trying to figure out what, in this febrile election season, that idea might be.

The fence itself is a formidable sight, spanning about one-third of the 2,000-mile frontier from California to Texas, and patrolled by about 20,000 agents. One of the most tightly guarded stretches is around the city of Nogales, which straddles the border. Here, the first world abuts the third. American Nogales, orderly and somniferous, pushes up against Mexican Nogales, an unruly metropolis of 300,000 souls where the Sinaloa cartel looms large.

John Lawson, a border patrol officer born in Pennsylvania, took us on a tour of the fence, a slatted metal barrier, 18 to 30 feet high, that undulates along the hills on either side of Nogales. It was built at a cost of $4 million per mile, which includes an array of military-style fortifications. We passed pole-mounted cameras, radars, vibration sensors and, in the dip of valley, a line of World War II-style Normandy barriers meant to stop any Mexican vehicle from crashing through America’s front gate. The border patrol reaches into the air, too, with a fleet of drones, balloons and Blackhawk helicopters.

And yet, the “migrantes” and the “traficantes” still slip through.

Officer Lawson pulled up on a small bluff overlooking the border and pulled out his binoculars. Half a mile away, inside Mexico, three young men trudged along a ridge, then vanished behind a splash of foliage. Farther along we saw other groups: spotters, employed by the cartel, Officer Lawson said. They use their cellphones to direct traffic, telling migrants and drug smugglers when to make a run for it. Looking left and right, on the American side, I counted six patrol jeeps, parked on hillocks.