I would say that abortion caused the illegal immigration situation. We're missing millions of US educated workers.
I do not believe they are related. Ted Kennedy pushed and got enacted the first acts of shamnesty in the 1960s, far before the murder of unborn children was legalized nationwide in 1973.
Every time we've had a shamnesty granted, it just attracts more illegals.