The Confeds couldn't have done well on their own. They had a good states cause, but slavery was doomed as a cause too and when it comes down to it, that's what it was about. You couldn't have 20th century nigger slaves period. The USSR also had in their constitution that all the 'republics' were autonomous and willing participants due to communism being an obvious superior point of view that nobody would ever ever break up with the mighty USSR that solved all problems forever.
Slavery is an artifact of the agricultural revolution that only exists in agriculture-heavy societies. Industrialization obviates the need for slaves, because you need workers who are somewhat more skilled, and you're trusting them not to break a very expensive machine so you're better off paying them. You can see everywhere that slavery disappears as industrialism progresses.
However, immigrant labor is an artifact of the industrial revolution. As countries industrialize, they get rid of slaves, but the replacement for that are immigrants from benighted places who are happy to get set up in a factory job that the existing residents would find distasteful or too dangerous to do. You can see how immigration tracked very closely to America's rapid industrialization, with a significant fall-off as World War II shut down borders and a recovery of imported immigrant workers soon after (minus Europeans).
England did a lot of the same thing in the 19th century, largely by taking in immigrants from Ireland and putting them in their shitty, dangerous factory jobs.
Of course, not everyone did it this way. Totalitarianism of various flavors offered another way to fill your factories and industrialize your country: just demoralize or propagandize big sections of your population until they're willing to work in subhuman conditions, and you've essentially turned your own populace into the "immigrant" workers.
Today's reaction against immigration is actually identical to the late 18th/early 19th century reaction against slavery. It is a large mass of people suddenly realizing that the new era we are in demands something different, and that automation and technological advancement have obsoleted the reason for an institution that had long been inhumane and destructive to the ways sane people want to live.
We had an agricultural age, then a mechanical age, and now a digital age. The ways we organized and moved people around in one era don't move fluidly to the next. Many, many thousands of people died in the struggles to end slavery and enter an industrial world. The kill count here, if we're lucky, will be a lot lower.