The relationship between good and evil and the struggle within man are dependent, as it were, on the continuous existence of God, Who allows things to happen and permits the anomaly called evil to flourish.
For evil is what God uses as an instrument to raise man up to Him.
As it is written in the Sefer Yetzirah: "Good distinguishes the evil and evil distinguishes the good."
The greatness of man stems from this struggle between good and evil.
This is why God has to build the anomaly of evil, making it possible for it to exist and flourish and then, when it has performed its function, making it null and void.
After one has defeated the evil impulse, it ceases to have any meaning.
Thus, the ceaseless war that man wages can be interpreted as a challenge for him to do all that he can while God is working against him at the other end.
And then as soon as man proves that he is able to stand the test, it all collapses and has no more significance, and something else starts up all over again.
There is a story in the Zohar of the king who wished to test the virtue of his son and thus sent a whore to tempt him.
Her task is rather ambiguous, if not actually frustrating, for her success might be, in reality, failure for all concerned; and yet the test has to be a real trial.
It cannot be make-believe.
Therefore, she hires another whore who, not understanding the meaning of the test, tempts him wholeheartedly.
From which, it may be gathered, the actual essence of evil is complex–the lower levels of evil do not even know that their function is only to serve as a temptation.
They enter the contest in all enthusiasm, even though their whole function will collapse as soon as man succeeds in standing up to the test.
It is as though God says to evil:
"Very well, it is all over; the tempter may go home."
Man, however, cannot do this.
It is God's task.
Man's task is to stand up to the trial.
–Rabbi Adin Steinsaltz
From The Long Shorter Way by Rabbi Adin Steinsaltz