"a tight pressing between two surfaces," 1806, from jam (v.). Sense of "machine blockage" is from 1890, which probably led to the colloquial meaning "predicament, tight spot," first recorded 1914. Jazz meaning "short, free improvised passage performed by the whole band" dates from 1929, and yielded jam session (1933); but this is perhaps from jam (n.1) in sense of "something sweet, something excellent."