The OT justifies slavery as opposed to mass slaughter of a conquered people. Also, slavery in the OT is a far cry from what a modern person understands as slavery. A man had to care for his slaves as he would a modern hourly worker; as well as provide adequate food and shelter. That, to me, seems far better than being killed.
Stoning was a form of execution no different in concept from the electric chair, lethal injection, firing squad, guillotine, etc. There were also stringent rules for when this sentence was carried out. True, it is more brutal; but it was the most common method widely available. The goal in a stoning is for the head to take a hit first, numbing the body or knocking them unconscious, therefore preventing them from feeling most of the pain for the rest of the execution. There are better methods, sure, but hindsight’s 20x20, and this was the best they had come up with at the time.
The genocide your referring too involves the slaughter of a race of people who delighted in killing their own. They engaged in brutal and near-constant human sacrifice to Baal ( I think it was Baal), were warlike for no reason other than to claim sacrifices and slaves (who’s treatment was probably close to what your mind first thinks of for slavery); and engaged in beastial sexual practices, including the rape of captive men women and children, mass orgies, and general sexual debasement.
Basically, the culture represented the absolute lowest level of humanity, and that is why they were wiped out; and justifiably so, to save the people of the surrounding territories, and any others who may have crossed paths with this race.