This post is not equating immigration and slavery. It is using this thing called a metaphor. It highlights an issue or argument using a comparison that shares relevant characteristics.
It's a comparison just a comparison it's really nothing else.
A specific necessity of a metaphor is that the two are not something you should be able to compare. Like time and apples. It isn't a metaphor if you compare something similar especially if you're trying to make the argument that the two things you're comparing are similar, that's specifically like the opposite of a metaphor