c. 1300, mote "a mound, a hill" (a sense now obsolete); late 14c., "ditch or deep trench dug round the rampart of a castle or other fortified place," from Old French mote "mound, hillock, embankment; castle built on a hill" (12c.; Modern French motte) and directly from Medieval Latin mota "mound, fortified height," a word of unknown origin, perhaps from Gaulish mutt, mutta.
The sense shifted in Norman French from the castle mound to the ditch dug around it. For a similar evolution, compare ditch (n.) and dike. As a verb, "to surround with a moat," early 15c. Related: Moated.
Old English dic "trench, ditch; an earthwork with a trench; moat, channel for water made by digging," from Proto-Germanic *dikaz (source also of Old Norse diki "ditch, fishpond," Old Frisian dik "dike, mound, dam," Middle Dutch dijc "mound, dam, pool," Dutch dijk "dam," German Deich "embankment"), from PIE root *dheigw- "to pierce; to fix, fasten." The sense evolution would be "to stick (a spade, etc.) in" the ground, thus, "to dig," thus "a hole or other product of digging."
This is the northern variant of the word that in the south of England yielded ditch (n.). At first "an excavation," later applied to the ridge or bank of earth thrown up in excavating a ditch or canal (late 15c.), a sense development paralleled by the cognate words in many languages, though naturally it occurred earlier in Dutch and Frisian. From 1630s specifically as "ridge or bank of earth to prevent lowlands from being flooded." In geology, "vertical fissure in rocks filled with later material which made its way in while molten" (1835).