A term borrowed from medieval Christianity. It refers to a technique of converting either a secular song into a religious song or vice versa by altering the words.
This technique was used in 12th century Spain, as poets and Paytanim would write above the first line of their poem a reference to a certain popular melody to which the lyrics could be sung. A famous example of this can be found in the Diwan of the sixteenth century Paytan rabbi Israel Najara.
Example of an Israel Najara's manuscript (the text in the red square is the reference to the popular melody in which the piyyut is ought to be sung)
This method of adaptation probably evolved due to the popularity of existing folk songs making it easy to sing and memorize a new poem or piyyut. Another reason is that new texts were written faster than new melodies and therefore one melody would be used for several texts.
Furthermore, in the 18th and 19th centuries, the Hassidim considered it a sacred task to transform secular texts into religious ones. One example of this is the song "Shechina shechina," a famous shepherds' song that was sung and “converted" by the Admor from Kalib (Hungary).