social development, stratification and intermarriage trough generations
like say the british decided irish werent ''realy human''(they almost did this any way) and used them as slaves instead of people they bought from say benin or nigeria
after abolition these would mostly intermix and you wouldnt even have the notion of 'those other guys' except maybe if someone was so very ginger its an eyesore
similarly, in many places like ottoman empire or china, slaves would integrate more easily and freed slaves were not realy percieved as that much of a low status, not lower than servants and pesants any way, in fact the staus of being free was more problematic in itself than possible 'ranking', all these intricacies and soft borders made it easier to assimilate
plus, castration was a thing in much of the world, so you didnt realy get a sustainable slave population, and females always integrate more easily, especialy in patriarhal cultures where shes part of a household any way, also, slaves werent that segregated
slaves themselves werent seen or treated as animal either, all sorts of different types of slavery and slaves existed, in some instances a slave could have higher rank than ordinary people
but with the whole race specific slavery thing, where the slave is designated by his skin color and assumed to be a head of cattle, and then with lingering rasist logic in local culture, segregation etc... the former slave population is isolated and so maintains its slave mentality and culture, only without both the constrains and the support of the former system
also notice slave mentality and the like do not relate so much to individual thinking, behavior or tendencies but to the general functioning and behavior of the that given population on the whole, meaning it gets worse in isolated agregate
all of which means that after liberating a whole distinct population without allowing them to fully interact and integrate, what you get is humans going feral