@Seggan My impression is that it was kind of both (in the Hebrew Bible). Debt was a major reason why people went into slavery; sometimes it was a temporary thing till their family could earn enough money to buy their freedom, and in theory an Israelite was supposed to let their Israelite slaves
go free after seven years, though I'm not sure if anybody actually did that.