1590s, "cloth having a velvet nap on one side," perhaps from Old English sceacga "rough matted hair or wool," from Proto-Germanic *skagjan (source also of Old Norse skegg, Swedish skägg "beard"), perhaps related to Old High German scahho "promontory," Old Norse skagi "a cape, headland," with a connecting sense of "jutting out, projecting." But the word appears to be missing in Middle English. Of tobacco, "cut in fine shreds," it is recorded from 1789; of carpets, rugs, etc., from 1946.
"copulate with," 1788, probably from obsolete verb shag (late 14c.) "to shake, waggle," which probably is connected to shake (v.).
And þe boot, amydde þe water, was shaggid. [Wyclif]
Compare shake it in U.S. blues slang from 1920s, ostensibly with reference to dancing. But compare shag (v.), used from 1610s in a sense "to roughen or make shaggy." Also the name of a dance popular in U.S. 1930s and '40s. Related: Shagged; shagging.
in baseball, "to go after and catch" (fly balls), by 1913, of uncertain origin. Century Dictionary has it as a secondary sense of a shag (v.) "to rove about as a stroller or beggar" (1851), which is perhaps from shack (n.) "disreputable fellow" (1680s), short for shake-rag, an old term for a beggar.