The Mishna on Amud Beis enumerates the ways in which Kodesh, sacrificial products, have stricter purity requirements than Terumah, produce set aside for the Cohanim.

The opening example is:

חוֹמֶר בַּקֹּדֶשׁ מִבַּתְּרוּמָה שֶׁמַּטְבִּילִין כֵּלִים בְּתוֹךְ כֵּלִים לַתְּרוּמָה אֲבָל לֹא לַקֹּדֶשׁ

one may immerse vessels inside other vessels to purify them for teruma; but not for sacrificial food, for which one must immerse each vessel separately.

Kesser Shem Tov (175), a compendium of teachings from the Baal Shem Tov, explains this teaching allegorically as a foundational way of understanding our relationship to Chomer, material and physical matter and desires.  

Everything that comes to a person in terms of impulses, thoughts and desires are actually a way to inspire a person to come close to God. For example, the emotion of love is to teach us how to experience love for God. Our desire for pleasures is our desire for the ultimate pleasure of connecting with God.

Therefore, if a person experiences what appears to be a random improper thought while he is studying Torah or praying, all is not what it seems. As it states in Megillas Esther (2:12), each maiden will come at its appointed time, that is, each seemingly empty thought and impulse (as in a childish maiden Na’arah) comes at the right time. One must seize the moment and transform this impulse and elevate it, as it is coming to you at that time for a particular beneficial purpose.

This can be compared to a father who quizzes his son with many confusing questions in order to sharpen his thinking skills. The strange thoughts coming into his head can be uplifted if unified with the words he is studying or praying.

This is alluded to in the words of the Mishna, “one may immerse vessels inside other vessels to purify them.” Words are vessels for thoughts and holy reverberations. The Mishna is saying one may purify material and dross thoughts by immersing the vessels of the profane inside the vessels of the pure. This is also alluded to in the verse, (Vayikra 26:3-4):

אִם־בְּחֻקֹּתַ֖י תֵּלֵ֑כוּ וְאֶת־מִצְוֺתַ֣י תִּשְׁמְר֔וּ וַעֲשִׂיתֶ֖ם אֹתָֽם׃ וְנָתַתִּ֥י גִשְׁמֵיכֶ֖ם בְּעִתָּ֑ם.

⁦If you walk in My laws and faithfully observe My commandments, I will grant your rains in their appointed time. Geshem rain, also means physicality Gashmiyus, so the verse can be read as follows: If you walk in my laws and remain connected to me, even the physical desires can be experienced properly in their appointed time.

What a gift the Besht has given us! He is helping us look for ways to accept whatever impulses and desire that seem to unconsciously pop into our head. Of course he isn’t advocating hedonistic lusting. Instead he is saying we somehow make peace with them by finding out what they offer spiritually. What does this mean, exactly? Probably Using the energy and the wish for connection and love in a positive way that fills spiritual and emotional needs. 

For you litvaks out there, the Mesilas yesharim says the same thing in chapter 26:

⁦But if after he has prepared himself with all these preparations, he persistently clings with powerful love and intense fear in pondering G-d's greatness and infinite exaltedness, he will separate himself from physical matters little by little and will direct his heart in all his actions and movements to the true inner clinging, until, a spirit from on high will pour upon him and the Creator will cause His Name to rest upon him, as He does with all of His holy ones.⁦He will then actually be like an angel of G-d, and all his actions, even the lowly and the physical ones, will be like Temple sacrifices and services…⁦However this refers only to one whose mind and intellect is always fixed on God's greatness, blessed be He, and His exalted holiness, such that it is as if he is actually among the lofty angels while still in this world.