Nikah is nothing more than a public announcement (with minimum of 2 people present) to announce your intention to have a sex partner. Slavery can be considered the same wy. The only difference in slavery based and nikah based sex is maybe the consent of the other party is not required in the former scenario. As non-human as it sounds, it was the cost-of-war in those days and both sides had this understating that once they get into the war with each other, it could result in their people becoming slave of the victorious party