First of all, it’s clear that the OT doesn’t mean “foreign pagan priestess” when it says “witch”. Israel was surrounded by pagan cultures, and Israelite men did run into non-Jewish pagan priestesses every once in a while, without having more problem with them than they had with all other pagans. When Tamar set out to trick her father-in-law Judah into giving her her rights, she apparently disguised herself as a pagan priestess/sacred prostitute. Judah didn’t exactly kill the allegedly pagan foreign chick.
Now we get into Hebrew, which I don’t understand, so this is all hearsay from me.
As for the “Witch of Endor”, there’s actually nothing in the Hebrew calling her a witch. She’s apparently identified as a “woman ghost-controller” ('esheth ba 'alath 'obh, with 'obh meaning ghost). She was in the business of compelling ghosts to do her will. (Interestingly, even though she’s a lawbreaker and Saul is her enemy, she still feeds him. Middle Eastern hospitality and Jewish mother syndrome!)
The people who weren’t supposed to be allowed to live were those who practiced “kishsheph”, sorcery. These people were apparently “mekhashsheph” or “mekhashshephah”.
As for the Greek stuff in the NT, that’s mostly talking about “pharmakeia” – sorcery, but especially giving drugs and potions – which apparently was the word used in the OT Septuagint to translate “kishsheph” words.
bible-history.com/isbe/W/WITCH%3B+WITCHCRAFT/
seems to be a very complete article.
I’ve seen a lot of discussion in the past of this, and some people feel that kishsheph was mostly all about poisoning. (Which was how it worked in ancient Rome.) Others think that kishsheph was about cursing people, in a non-religious way; but it seems like Hebrews did plenty of cursing people without calling in professionals. So it probably was about doing pagan magic with pagan gods, while still claiming to be part of Israel. Sort of being a subversive, given that Israel’s whole claim to be a people was their covenant relationship to God.
There’s also a whole list of magical professions you weren’t supposed to have “among you”, in Deuteronomy. It’s coupled with people who sacrifice their kids to Moloch, which ties in to not being able to be a pagan and an Israelite at the same time.
Anyway, the point was not to go around killing people who did magic, but rather to not let people live
as part of Israel who were doing heathenish things like worshipping false gods or doing magic. Anybody who wanted to pursue careers in the exciting field of sorcery could do so, as long as he or she went to pursue said opportunities in a pagan community and wasn’t claiming to be an Israelite anymore. Breaking God’s laws so blatantly in Israel’s camp could bring down God’s wrath on everybody else, too.