It is not simply a hangover from the past that can be destroyed through educating ignorance away. Modern capitalism constantly reproduces existing racial divisions and invents new ones. Capitalism is a dynamic system. It depends on moving workers from one part of the world to another to meet the demand for labour. The US working class, for example, is made up almost entirely of immigrants.
Capitalism brings together workers from a range of backgrounds.
That has enriched everyone's culture and lives. But workers are also forced to compete with one another on the labour market for resources. This provides a seedbed for turning differences between groups of workers into intense racial divisions. Employers can fuel this scapegoating by using immigrant workers to undercut indigenous labour. Victorian capitalists deliberately used Irish workers in Britain in that way.