The Gaza strip, geographically small but with about 2 million residents (see earlier post) has long seen illegals crossing into Israel (a length of about 60 km or 37 miles) and Egypt (about 12 km). The problem is less from them going over the top than underneath the border with tunnels. As a result the two countries have had to extend the fortification well below ground.
Gaza is, of course, full of Muslim terrorists (primarily the Hamas group) who use the tunnels to send out jihadists to conduct attacks on Egyptian and Israeli security personnel and to smuggle explosives and weapons in to make rockets etc. As as result the wall goes 20 metres (66 ft) below the surface and is made of bomb-proof, super-strength steel.
The problem with Mexico is different from Gaza as the illegals are mostly drug dealers and economic migrants who aren't interested in being part of a mass exodus of their fellow countrymen to wage jihad, but simply to enrich themselves. Thus a physical barrier wouldn't need that kind of measure which would involve big cost if extended over some 2,000 km, even if Mexico ends up paying for it. In fairness we think the cost of border enforcement including physical barriers should be shared between the two countries.