I think you need to explain what the term means and that it's a mean and derogatory term. And then you have to help your child to understand that it's the other child's problem who called them that name.
They were afraid if the children were not very obedient they would get in trouble with white people for being uppity or being too agressive. So they were very, very strict. I would say today that we don't need to beat our children.