There is no such thing as truly secure borders. If the illegals are safe once they are X miles from the border, then they will come. If the only penalty for trying is they get put back to try again, then they will try until they succeed
The only solution is sanctions against any employer that hires them, and any local govt that issues them benefits
Putting them in jail if they’re caught crossing instead of just putting them back would be a discouragement.