c. 1200, diggen, "to make a ditch or other excavation," a word of uncertain origin, perhaps related to dike and ditch, either via Anglo-French diguer, from Old French digue "dike" (which is ultimately from Proto-Germanic *dīk-, from PIE root *dheigw- "to stick, fix") or directly from an unrecorded Old English verb. The older native words were deolfan (see delve), grafan (see grave (v.)).
Transitive meanings "form by excavation, make by digging," also "obtain or remove by excavation" are from late 14c.; figurative sense of "discover by effort or search" is from early 15c. Meaning "to penetrate" is from mid-15c.; transitive sense of "cause to penetrate, thrust or force in" is by 1885.
In 19c. U.S. student slang it meant "study hard, give much time to study" (1827); the 20c. slang sense of "understand" is recorded by 1934 in African-American vernacular. Both probably are based on the notion of "excavate." A slightly varied sense of "appreciate" emerged by 1939. The strong past participle dug appeared in 16c. but is not etymological.
late 17c., "a tool for digging," from dig (v.). Meaning "archaeological expedition" is from 1896. Meaning "a thrust or poke" (as with an elbow) is from 1819; figurative sense of this is by 1840.