Common misconception: that 19th century Union soldiers wore hot pants and crop tops with pink horsetails stuffed in their bussies and fists held high in solidarity with their black brothers and sisters.
In reality, they were all mostly racist, just the ones in the South moreso. Also, their entire economy was based on slave labor.
Capitalism guarantees hardship in boom and bust cycles. Humans are easily made to believe that the weak, outnumbered, and different are the enemy. That the same people who can't muster up anything like a respectable rebellion are somehow a threat to the most powerful nation in the world.
The moment Africans were trafficked to the North American continent, they were guaranteed to be the forever enemy.