1590s, "cloth having a velvet nap on one side," from Old English sceacga "rough matted hair or wool," cognate with Old Norse skegg "beard," from Proto-Germanic *skagjan, perhaps related to Old High German scahho "promontory," with a connecting sense of "jutting out, projecting." Of tobacco, "cut in fine shreds," it is recorded from 1789; of carpets, rugs, etc., from 1946. Shagbark as a type of hickory is from 1751.
"copulate with," 1788, probably from obs. verb shag (late 14c.) "to shake, waggle," which probably is connected to shake (cf. shake, shake it in U.S. blues slang from 1920s, ostensibly with reference to dancing).
And þe boot, amydde þe water, was shaggid. [Wyclif]
Also the name of a dance popular in U.S. 1930s and '40s. The baseball verb meaning "to catch" (fly balls) is attested from 1913, of uncertain origin or connection to other senses of the word.