ラテン語のcarmen(歌う、呪文を唱える)が語源のcan(唱える)が語源で、語源的にはchant(聖歌)、cantata(カンタータ)と同じ。 mの前にnがr化したもので、gen(子孫を残す)が語源のgerm、germaneと比較される。
A yet stronger power than that of herb or stone lies in the spoken word, and all nations use it both for blessing and cursing. But these, to be effective, must be choice, well knit, rhythmic words (verba concepta), must have lilt and tune; hence all that is strong in the speech wielded by priest, physician, magician, is allied to the forms of poetry. [Jacob Grimm, "Teutonic Mythology" (transl. Stallybrass), 1883]Sense of "pleasing quality" evolved 17c. Meaning "small trinket fastened to a watch-chain, etc." first recorded 1865. Quantum physics sense is from 1964. To work like a charm (figuratively) is recorded by 1824.