Vayikra18:30

וּשְׁמַרְתֶּם אֶת־מִשְׁמַרְתִּי לְבִלְתִּי עֲשׂוֹת מֵחֻקּוֹת הַתּוֹעֵבֹת אֲשֶׁר נַעֲשׂוּ לִפְנֵיכֶם וְלֹא תִטַּמְּאוּ בָּהֶם אֲנִי יְהוָה אֱלֹהֵיכֶם׃

So you shall keep My charge, not to do any of the abominable customs that were done before you, and not make yourselves impure with them. I am the Eternal your Almighty."

Vayikra 18:30

וּשְׁמַרְתֶּם אֶת־מִשְׁמַרְתִּי לְבִלְתִּי

Vayikra / Leviticus 18:30 · Sod

Vayikra 18:30

וּשְׁמַרְתֶּם אֶת־מִשְׁמַרְתִּי לְבִלְתִּי עֲשׂוֹת מֵחֻקּוֹת הַתּוֹעֵבֹת אֲשֶׁר נַעֲשׂוּ לִפְנֵיכֶם וְלֹא תִטַּמְּאוּ בָּהֶם אֲנִי יְהוָה אֱלֹהֵיכֶם׃

So you shall keep My charge, not to do any of the abominable customs that were done before you, and not make yourselves impure with them. I am the Eternal your Almighty."

Sod סוֹד

The charge the Eternal keeps

Sometimes the guard and the one guarded keep the same thing. What do they protect together?

Yismach Moshe: "keep My charge" is also read as "what I keep". The Blessed One keeps Israel from the sword of Esav (Esau) through the sign of the covenant, circumcision, and forbidden unions spoil this sign. That is why the verse stands at the end of the section on them. Midrash Lekach Tov: the Eternal opened the section on forbidden unions with His Name and closed it with His Name: "I am the Eternal your Almighty."

How Yismach Moshe and Midrash Lekach Tov explain it

Yismach Moshe So you shall keep My charge

The sages, of blessed memory, interpreted (Moed Katan 5a): "set a charge around My charge". But if it was said only for this, it is hard to see why it comes right after the section on forbidden unions: for throughout the Torah one is commanded to set a charge around the charge. And in the Jerusalem Talmud (Rosh Hashanah 1:3) it is brought: "Keep My charge": what I keep, for the Holy One, blessed is He, keeps His Torah. This is even more puzzling, for it has nothing to do with the section on forbidden unions, only with the commandment of Shabbat, the commandment of kindness and the like. And it seems to me that this is explained by the book "Ya'arot Devash", by what is said there on the verse "A michtam of David" (Tehillim / Psalms 60:1). Rashi explained: his blow (מַכָּתוֹ) was whole (תָּם), because he was born circumcised. "When he fought with Aram-Naharayim, and Yoav (Joab) returned and struck Edom" (Tehillim / Psalms 60:2). The gist of that book's words: Mars is the star of Esav, so he was told: "By your sword you shall live" (Bereshit / Genesis 27:40), and the commandment of circumcision cancels his power. That is why Moshe (Moses) told Yehoshua (Joshua): "Go out, fight with Amalek" (Shemot / Exodus 17:9), and did not do it himself: for he was born circumcised, as it is said of him "that he was good" (Shemot / Exodus 2:2), as the sages interpreted (Sotah 12a), so he had no power to weaken the power of Mars. And Israel did not circumcise in the wilderness, so he chose Yehoshua. This is the meaning of "when he fought with Aram-Naharayim", and then "Yoav returned and struck Edom". For it is hard to see why he struck Aram himself, but to subdue Edom Yoav returned. That is why David is called "michtam": his blow was whole, he was born circumcised, so he had to send Yoav. And that is why Rashi explained that when David foresaw the decrees the kingdom of Edom would issue against Israel, that is, the ban on circumcision, he said: "Almighty, You have cast us off" (Tehillim / Psalms 60:3), for then there is nothing with which to cancel the power of Esav. Thus far the words of that book, see there. And in the portion Lech Lecha, about the commandment of circumcision (Bereshit / Genesis 17:10), it says: "This is the sign of the covenant which you shall keep between Me and you." It should have said: "this is the sign of the covenant between Me and you, keep it." But as it is written in the verse, it means that the keeping is between Me and you, that is, the Holy One, blessed is He, keeps too, though it is written "you shall keep". Still, "between Me and you" means that the Blessed One keeps too. And one must understand what keeping the Blessed One does. One cannot say that Israel keep the commandment and the Blessed One keeps the circumcised from Gehinnom: for then why must Avraham sit at the entrance of Gehinnom (Eruvin 19a)? But it can be explained by "Ya'arot Devash": the Holy One, blessed is He, keeps them from the sword of Esav and from his decrees through the holy sign of the covenant. And it is known that one who sins with forbidden unions spoils the holy sign of the covenant. This is "keep My charge", what I keep: not to spoil the holy sign of the covenant. And understand.

Midrash Lekach Tov So you shall keep My charge

Set a charge around My charge: these are the secondary bans on intimacy that the sages decreed. Another explanation: "keep My charge": to warn the court about this. "Not to do any of the abominable customs that were done" teaches that all forbidden unions are called impurity. "I am the Eternal your Almighty": this is what we said, He opened the section on forbidden unions with the Name of the letters yud (י) and hei (ה) and closed it with the Name of the letters yud (י) and hei (ה).

Takeaway

The section on forbidden unions opens with the words "I am the Eternal your Almighty" (Vayikra / Leviticus 18:2) and ends with them in this verse.
"Ya'arot Devash" ("Forests of Honey") is a book of sermons by Rabbi Yonatan Eybeschutz (18th century).