When encountering a slaver ship, you have a couple of options to acquire a new crew member.  You can buy slaves, fight to receive a slave as a bribe, or kill the slaver crew to gain your choice of slaves.

Is there anything that affects which races are involved, or is it completely random?

For example:  If I am in an Engi controlled sector, am I more likely to get an Engi from slavers?