a slaughterer: one whose work is killing, whether butchering animals for the table or putting prisoners to death for the king
This is an agent noun built from the ordinary word for slaughtering an animal. At its root it names the person who does the killing. In everyday life that is the palace kitchen worker who slaughters and dresses the meat, so English Bibles reasonably call him the cook.
Far more often the word appears in a fixed royal title, literally the chief of the slaughterers, which English versions render captain of the guard. Two famous officials carry it: Potiphar in Egypt, into whose custody Joseph is handed, and Nebuzaradan, the Babylonian officer who oversees the destruction of Jerusalem. These were not merely bodyguards. Their corps carried out the king's executions, and the same underlying idea of killing runs through both the kitchen and the court.
So the two uses are not two unrelated words but one word applied in two settings. Whether the victim is an animal for the feast or a condemned prisoner, the person named is the one who does the slaughtering.