They didn't. Rather some Africans sold other Africans in to slavery. They did it for money. Just as Greek and Romans sometimes sold other Europeans into slavery.
Yes, many Africans sold other Africans to trade for rum from the Europeans; also for their own protection to keep from being enslaved, themselves, they gave up their prisoners.
Yes, during the historical period when Europeans were going to Africa to obtain slaves, Africans did sell other AFricans into slavery. Generally speaking, the prevailing morality of the time was that...