I remember a time when Mexican farmers followed the natural northward cycle of harvest after they brought in their crops and they weren't vilified or hunted down for their status. Many border crossings didn't even have checkpoints, as the workers were welcomed. When the US harvests were completed the workers simply collected their pay in dollars and returned to their own homes where those dollars were worth much more than they were here.
It wasn't until the GOP began using the immigrant workers as cover, projecting their guilt for waging war on the American working class, and for their failures, that caused the immigrants to want to stay in the US permanently. The risk posed by draconian laws and punishments for what was a misdemeanor violation, similar to a traffic ticket in US law made their seasonal trek to find extra work too dangerous and expensive. It also connected people who wanted nothing more than honest work with the criminal elements that had the experience and connections needed from their drug trafficking.
Simply finding permanent work in the US was not difficult, as employers were more than happy to evade wage and benefit demands from US workers by hiring undocumented immigrants under the table. Their economic status and political connections assured that they would never be made accountable for the much more serious legal infraction of knowingly hiring an undocumented worker. The GOP cemented this assurance by playing on the inherent racism of its base, continually portraying immigrant workers as threatening criminal elements.
The only part of the puzzle left for the business to complete was providing an incentive to drive immigration from a mostly agrarian economy into the factories and mills in the US. This was accomplished with exports of heavily subsidized crops into the economies of our southern neighbors. It was often even masked under the cover of "foreign aid", shipping grains and other food products into direct competition with local farmers at below their real cost.
This cannot be accurately portrayed as an exclusive GOP tactic though. NAFTA was intended to make maximum gain from these displaced agricultural workers, and that was repeated by Hillary in her dealing with Haiti, using the US subsidized rice to drive workers into the textile mills to work for cheap. She, while on the board of Walmart, even used her political influence to cause the rejection of higher minimum wage laws.