Let us examine regarding this commandment from the Torah to not seek revenge. Seemingly this must be referring to someone who has a reason in the first place to be upset with someone and have a desire to seek revenge based on something that was done to him/herself. And we see this commandment is to use your will power to overcome and not get that revenge. So then why right after does the Torah command us to 'Love your fellow like you love yourself', this is too much of one extreme to another (from hating to loving), wouldn't it be enough to say don't get revenge, but why do I have to love this person like I love myself?
And we will say with the help of Heaven by prefacing what is taught in the Talmud -
whoever forgoes his reckonings with others for injustices done to him, the heavenly court in turn forgoes punishment for all his sins.
And to explain this we can look into what the Baal Shem Tov had said regarding this verse in Psalms -
The LORD is your guardian,
the LORD is your protection
at your right hand.
The Hebrew word here for protection, Tzelcha, is also the same letters as the word shadow, and it can be read as well that the Lord is your shadow. How though? Just like the shadow follows the movement of the human casting it, so too HaShem acts with us as we act, action for action. Therefor, since a person overcame his ego and forgave someone, so too will the Holy One Blessed be He will act in according with his actions, and will forgive him/her of their sins.
And in this light we can explain the following verse -
And all your children shall be disciples of the LORD, And great shall be the happiness of your children;
Is that Israel, in the way they act, as if to say 'teaches' HaShem how to act with them. And in accordance with how they act, HaShem will act right back in that same accordance. And certainly when a person contemplates this reality that however he acts in this world, so too will HaShem act with him, he/she becomes aroused to distances themselves from evil/negativity from the farthest side of the spectrum, and go right into the path of goodness, all so that in order HaShem will act with them in a manner of kindness and mercy, to bring an influx of goodness their way.
So this is why it says do not seek revenge, and then right away tell you to also love that person! Its not suffice to just withhold from hate and revenge towards someone who wronged you, rather we have to go to the complete opposite side of the spectrum and actually love that person like you love yourself!
And by means of this not only will you be forgiven of past iniquities of yours, but in addition to that, you channel down more mercy from Heaven in your life going forward. As there is an aspect that your iniquities as well causes pain and distress to HaShem, and now that you overcame your attribute to seek revenge and conquered, so too HaShem will repay you act for act regarding the fact that you had forgiven someone, and that you are now even trying to love and show love to this person, so HaShem acts in this accordance and awakens Heavenly mercy on you.. and this is why the verse ends with the words saying "Ani HaShem' - I am HaShem, which is the name of the attribute of Mercy for G-D, that in the merit of fulfilling this commandment of loving your neighbor like you love yourself, you are worthy to pull down onto yourself the attribute of Mercy, from the reality of an action for an action.
And in truth this is a tremendous level to reach to humble yourself in such a way, and certainly this is not an easy pathway to break your ego and to uproot from the depths of your heart every ounce of hate you were holding towards your friend that wronged you, and even furthermore, now you are even going to love him/her like yourself! And such a matter like this is considered by the Holy One Blessed be He as if you brought him a Temple sacrifice, as you are literally sacrificing a part of yourself here!
And its possible to explain with this logic the following verse -
דַּבֵּ֞ר אֶל־בְּנֵ֤י יִשְׂרָאֵל֙ וְאָמַרְתָּ֣ אֲלֵהֶ֔ם אָדָ֗ם כִּֽי־יַקְרִ֥יב מִכֶּ֛ם קׇרְבָּ֖ן לַֽיהֹוָ֑ה מִן־הַבְּהֵמָ֗ה מִן־הַבָּקָר֙ וּמִן־הַצֹּ֔אן תַּקְרִ֖יבוּ אֶת־קׇרְבַּנְכֶֽם׃
Speak to the Israelite people, and say to them: When any of you presents an offering from yourself of cattle to יהוה: You shall choose your offering from the herd or from the flock.
The Hebrew word above for bringing from yourself is Mikem (מִכֶּ֛ם), teaching us that when you overcome your ego, its done in a way where you are literally giving a piece of yourself, and that you broke and uprooted negativity within you. And furthermore, you flipped the scenario to good by now loving this person like you love yourself, and by means of this, the Holy One Blessed be He will act with him/her action for action, and will bestow upon this person much goodness!
And this is hinted to in the word מִכֶּ֛ם, which is an acronym for מדה כנגד מדה (which is the Hebrew phrase of Action for Action, otherwise known as Karma) !!!