You've hit on something very basic. No wall will work unless something unpleasant is likely to happen to anybody who tries going over it. Not much of a fence is needed if something very unpleasant is very likely to happen to anybody trying to cross it.
Here in San Diego, on the border we’ve got a double wall and in some places a triple wall, plus motion detectors, drones, stadium lighting and Border Patrol surveillance 24/7.
Our biggest problems are tunnels under the wall, 70 miles of oceanfront with no wall and visa overstayers who come here legally but don’t leave when their tourist, student, or work visas are up.
Also the Obama administration gives Green Cards(Permanent Lawful Residents) to about 140,000 legal Mexican immigrants every year and about a million Green Cards per year to legal immigrants from all nations