The people of A, finding themselves easily able to dominate the people of B due to A’s considerably more advanced technology, realise that they could if they wanted enslave B people, bring them back to A, and make them work for nothing, thereby making life considerably more comfortable for A people.
However, A people do have some sense that treating other humans as possessions is wrong. (Indeed they have an uneasy feeling that treating other people as objects is the very definition of wrong.) This makes things very awkward, because the idea of enslaving B people, and getting all that unpleasant work done for nothing, really is very appealing, yet it is important to most As to think of themselves as good people who do the right thing.
Luckily, they find a way round the problem. They decide that actually it’s fine to enslave B people because B people aren’t fully human and therefore the usual rules don’t apply.
Some A people get so carried away by this thought that they declare that the enslavement of B people is actually in B people’s own interest, because in that way the Bs will be able to learn from the As what it means to really be human. Others decide that B people are so manifestly inferior that they should be treated with exceptional harshness and severity in order to contain their inherent wickedness. Their own cruelty is thus made thoroughly moral by their awareness of the cruelty they are thereby keeping in check.
However, for reasons irrelevant to the present story, a time nevertheless comes when the government of A decides to abolish slavery, and to grant citizenship to all the former slaves. In legal terms, B people are now the equal of A people. Indeed, legally speaking, they are A people. (By now, after all, few ‘B people’ have ever set eyes on B.)
But many A people refuse to accept that B people really are their equals. After all, if they were to admit that B people are as human as themselves, that would mean admitting that their behaviour towards Bs up to now has been appallingly bad. Therefore they persist in their belief that B people are inferior, and continue to treat them harshly, so as to demonstrate that there was nothing wrong with their former behaviour, that they have nothing to be ashamed of, and that they can therefore continue to think of themselves as good.
And since they continue to treat B people harshly, this means that, even a generation after the emancipation of the B people, many A people still cannot allow themselves to think of Bs as their equals, because that would mean admitting, not only that the former enslavement of B people was wrong (which actually wouldn’t be so hard to do, given that the current generation weren’t implicated in it), but that their behaviour since has also been wrong.
And so, for many generations, many A people persist in treating B people harshly and cruelly in order to prove themselves that they really are good people.