c.1400, probably a fusion of Middle English scratten and crachen, both meaning "to scratch," both of uncertain origin. Related: Scratched; scratching. Billiards sense of "to hit the cue ball into a pocket" is first recorded 1909 (also, originally, itch), though earlier it meant "a lucky shot" (1850). Meaning "to withdraw (a horse) from a race" is 1865, from notion of scratching name off list of competitors; used in a non-sporting sense of "cancel a plan, etc." from 1680s.
1580s, from scratch (v.). Slang sense of "money" is from 1914, of uncertain signification. Many figurative senses (e.g. up to scratch) are from sporting use for "line or mark drawn as a starting place," attested from 1778 (but the earliest use is figurative); meaning "nothing" (in from scratch) is 1922, also from sporting sense of "starting point of a competitor who receives no odds in a handicap match."
in Old Scratch "the Devil," 1740, is from earlier Scrat, from Old Norse skratte "goblin, monster," a word which was used in late Old English for "hermaphrodite" (cf. Old High German scrato "satyr, wood demon").