Shavua Tov. Rabbeinu Bechaye uses the story of Cain and Abel that it is Hashem Himself that created good and evil. He quotes a Pasuk from Isaiah that specifically says that אני ה׳ בראתי אור ובראתי רע, “It is I Hashem who created light and evil.
It is further explained that Hashem did this as a means of rewarding the Tzaddikim of the world for their choosing good over evil.
Cain chose to be jealous of his brother. Instead of offering fruits of the שבעת המינים, the Seven Species, he offered inferior fruits as a sacrifice. Abel chose good and offered from the best of his flock in order to honor G-d.
This is a basic concept of Judaism. One can become a great Tzaddik if he applies himself and makes the right choices. On the other hand, one can be total evil where he has no place in this world.
This is why there is Amalek and the Seven Nations. It is considered an act of mercy to destroy them. For when evil is erased, the world becomes a better place.