Imagine if one ethnic group invented a derogatory term for another ethnic group, using it to portray them as basically another, lower species of human. Now, imagine if that word became popular among the targeted ethnic group to the point where they commonly use it between themselves when referring to one another in a jocular, and not derisive manner. Now, imagine if that word was no longer used by the ethnic group who originated it because it was still considered derogatory.
Hard to imagine, I know; but try.