All musicians refer to an informal and exhilarating musical session as “jamming,” but the term first surfaced in the jazz world during the 1920s.
“Jam” in jazz is a short, free, improvised passage performed by the whole band.
It means pushing or “jamming” all the players and notes into a defined free-flowing session.
And just like the preserved fruit “jammed” into a jar, a musical jam is sweet!
Preserved fruit was first called jam during the 1730s simply because it was crushed, then “jammed” into a jar.
To be “in a jam” has the same origin and means to be pressed into a tight or confining predicament.
Jamming radio signals is a term from World War I and means to force so much extra sound through a defined enemy channel that the original intended message is incoherent.
All this is from jam, a little seventeenth-century word of unknown origin that meant to press tightly.