In the 1930s, during the Great Depression, the United States deported large numbers of recent Mexican immigrants so that American citizens could take over the agricultural jobs. Then during World War II, with most of our male work force abroad in uniform, we needed them as workers again, and started the Bracero Program. In the modern day, we are a little split personality on this issue, where we enjoy the benefits of their labor - cheap food and products, their spending in our economy, paying taxes for Social Security they will never get back, etc., at the same time as some want all undocumented workers deported. We want our cake and eat it too.
The first part of this question is clearly the easier to answer. Mexico has long been viewed as a source of labor. This goes back at least to the time of World War II when the bracero program brought lots of Mexicans as guest workers to the US.
As for the second part, I suppose we could say that we leave unwanted workers in Mexico by our use of illegal immigrant labor. We get the benefit of having the illegals come (we use their labor) but (you can argue) we can send them back when they are not useful anymore. Legally speaking, we can also raise or lower quotas to let more or fewer Mexicans to come up depending on our needs.
I'm not sure I buy that, but that's how I would argue it if I had to.