Just a little bit about the development of this concept leftover from notes:
Among those books of the Hebrew Scriptures written before 300 BCE, the term "satan" (root word "s'tn"

appears often. The word is derived from the original Hebrew verb "satan" which means "to oppose." The Septuagint translation of the Hebrew Scriptures into Greek was widely used in the early Christian church. They translated "satan" as "diaboloc" from which we derive our English term "devil" and "diabolic."
The word is used to refer to:
Any person acting as an accuser or enemy. For example: 1 Samuel 29:4: The Philistines were distrustful of David, fearing that he would be a satan. (translated "adversary" or "someone who will turn against us"

.
2 Samuel 19:22: Shime-i apologizes to King David. The King rejects the apology, saying that they should not be a satan to each other (translated "adversary" or "opponent"

.
1 Kings 5:4: King Solomon is talking to Hiram, the King of Tyre. He says that now that there is neither satan nor bad luck to stop him, he can build the Temple. (translated as "adversary", "enemy", or "one who opposes"

.
1 Kings 11:14: God raised up Hadad the Edomite as a satan against Solomon. (translated as "adversary," or "opponent"

.
A divine messenger sent by God as an adversary: Numbers 22:22 & 32: God appears in a dream, telling Balaam to go with the princes of Moab to meet Balak. But when Balaam sets out the next morning on his donkey, God is angry with him for some reason, and sent an angel/messenger to kill him. The donkey saw the angel and took evasive actions. The angel was invisible to Balaam, who beat the animal. The donkey asked Balaam why he had beat her three times. Balaam, who doesn't seem to realize that a talking donkey is an unusual occurrence, replies. The angel then appears and explains that he has come as a satan to kill him. (translated as "one who opposes, "withstand," "adversary"
a member of God's inner council; a type of chief prosecutor of Heaven: 1 Chronicles 21:1: Satan, "a supernatural evil emissary," acting on God's behalf, has influenced David to hold a census. The census is taken, and God is angry for an unknown reason. Perhaps God does not want humans to be aware of the strength of the army. God then offers David his choice of one of three punishments: a 3 year famine, 3 months of fleeing before his enemies' armies, or a plague throughout Israel. David selects the plague and God killed 70,000 men (and presumably a similar number of women and many tens of thousands of children). In 2 Samuel 24, the identical event is described. However, this time, the text states that God influenced David to hold the census. Even though God had incited David to enumerate the men of Israel and Judah, he was still angry that it was done and punished the Israelites with a plague. The writings in 2 Samuel are believed to be the original account; 1 Chronicles came later. It is believed that when Samuel was finally edited (circa 560 BCE), the editors thought that all supernatural actions (good and bad) came from God. When Chronicles was written over a century later, (circa 400 BCE) the author viewed God as operating indirectly through his helpers.
Job 1 and 2: Satan is described as one of the members of the court of heaven. God mentions that he is impressed at the behavior of Job, a blameless man who has lived an upright life. Satan attributes Job's commendable behavior to his good fortune and says that Job would soon curse God if he had a string of really bad luck. God decides to conduct an experiment with Job; he instructs Satan to destroy all that Job has: kill his animals, murder his employees, and murder his innocent children. But, even after these disasters, Job still does not curse God. So God instructs Satan to up the ante by returning to earth and destroying Job's health. Here, Satan is portrayed as a servant of God whose task it is to dutifully carry out evil deeds at God's instruction.
Zechariah 3:1-7: Satan is again portrayed as a member of God's council. Here he objects to the selection of Joshua as the high priest.
There are no passages within the older parts of the Hebrew Scriptures where Satan is portrayed as an evil devil - the arch enemy of God and of humanity. At most, he is described as a henchman who carries out God's evil instructions. There is no dualism here between two powerful supernatural entities: an all-good God and an all-evil Satan. God is portrayed as performing, directly and indirectly, both kind and evil deeds. When:
plagues are to be sent, or
a great genocidal flood is created to kill off almost all of humanity, except for Noah and his family, or
Onan was killed because he practiced an elementary form of birth control, in violation of a cultural tradition, or
Sodom and Gomorrah was destroyed because its residents were abusive to the needy and to strangers, or
Lot's wife is turned into a pillar of salt because she looked the wrong way,
it is God who does it. In essence, the ancient writers of the early Hebrew Scriptures looked upon Jehovah as performing both good and evil deeds. A good indication of this is found in:
Isaiah 45:6-7:
"...I am the LORD and there is none else. I form the light and create darkness. I make peace and create evil. I the LORD do all these things." (KJV)
or in Job 9:22-23:
"...[God] destroys both the blameless and the wicked. When a scourge brings sudden death, he mocks the despair of the innocent." (i.e. laughs at the suffering of the victim)
or in Lamentations 3:37-38:
"Who has commanded and it came to pass, unless the Lord has ordained it? Is it not from the mouth of the Most High that good and evil come?"
Just jibberish they used to teach in those liberal Southern Baptist seminaries.