People grow up in small towns and graduate high school. There’s no job for them available. They move to the big city where there are jobs. They are willing to work, maybe, for less than somebody else because they’re desperate And it’s more than they were making earning zero in a small town.
Imagine somebody growing up and graduating from school south of the border. If they live in a small town there may not be a job. If you’re going to travel to the big city one may as well keep going across the border to the north and make big bucks. In fact back in the early NAFTA era, some of the factories built just south of the US Mexico border had trouble filling jobs with Mexican citizens. The jobs paid more than the average job in Mexico but less than the average job in the US. People just ended up going a little farther across the border to make more money.
I know experienced drywallers who suffered economically due to illegal immigration. The “undocumented workers” would work for several dollars less than the going rate. Eventually it drove wages down for everybody.