Earlier quoted context omitted.
Why not both? It is a feedback loop. When the US allowed railroad/mine workers from China, it is true that Chinese labor wanted a better future and that capitalists want to use Chinese labor to suppress American wages. For instance, look at the animosity towards Chinese workers in Wyoming by European workers: https://en.wikipedia.org/wiki/Rock_Springs_massacre
Do you think the European workers were in the right? Is the solution to kick out (let alone slaughter) the Chinese, or is it to make them less exploitable by companies?
So, when foreigners want to come to the US to work, these foreigners find the working conditions (say, 996 of today) is better than working for the corporate and the government exploiters in their home countries.