Local tradition states that the dyke was used to hide cattle from raiders or to interfere with raiders returning with stolen sheep, cattle, horses and other goods, delaying them long enough for pursuers to catch up with them.

In a number of places along its route it has been utilised and modified or possibly originally built as a head-dyke which physically separated the arable lower lying land from the upland pastures which were grazed by sheep and cattle which would have otherwise eaten any arable crops.
The terms 'in-field' and 'out-field' are sometimes applied and both are clearly marked on the landscape as green lush vegetation on lower lying land against the more complex colours of bare rock, heather, bracken, etc.
on the moors or out-fields.
The development of field boundaries meant that head-dykes were no longer necessary and they fell out of use in the 18th and 19th centuries.

The often erratic route may be explained by the need to enclose as much good quality arable land as possible.

The dyke has also been proposed as a tribal territorial boundary or as a medieval land boundary however the irregular course of this linear feature makes this unlikely.

The course of the Deil's Dyke is not noticeably associated with the many defensive features that exist in Nithsdale, such as Iron Age forts, medieval mottes, etc.
although the linear earthwork near Durisdeer is linked with the site of the medieval castle.

The Catrail in Roxburghshire, southern Scotland, has a number of similarities with the Deil's Dyke and consists of a bank and a ditch and runs for 11.5 mi (18.5 km).
It is considered to be a territorial land boundary dating from the Early Middle Ages and was once considered to link up with the Deil's Dyke.

Some deer hay winds or elricks may have consisted of banks and ditches several kilometres long that were used to direct deer for the purpose of capture and the Deil's Dyke fits this description.
 "Deer hunting has left physical traces on the landscape in the form of banks and dykes used either as park boundaries or for trapping the deer".
Local tradition states that the dyke was used to hide cattle from raiders or to interfere with raiders returning with stolen sheep, cattle, horses and other goods, delaying them long enough for pursuers to catch up with them. 
In a number of places along its route it has been utilised and modified or possibly originally built as a head-dyke which physically separated the arable lower lying land from the upland pastures which were grazed by sheep and cattle which would have otherwise eaten any arable crops. The terms 'in-field' and 'out-field' are sometimes applied and both are clearly marked on the landscape as green lush vegetation on lower lying land against the more complex colours of bare rock, heather, bracken, etc. on the moors or out-fields. The development of field boundaries meant that head-dykes were no longer necessary and they fell out of use in the 18th and 19th centuries. 
The often erratic route may be explained by the need to enclose as much good quality arable land as possible. 
The dyke has also been proposed as a tribal territorial boundary or as a medieval land boundary however the irregular course of this linear feature makes this unlikely.
The course of the Deil's Dyke is not noticeably associated with the many defensive features that exist in Nithsdale, such as Iron Age forts, medieval mottes, etc. although the linear earthwork near Durisdeer is linked with the site of the medieval castle.
The Catrail in Roxburghshire, southern Scotland, has a number of similarities with the Deil's Dyke and consists of a bank and a ditch and runs for 11.5 mi (18.5 km). It is considered to be a territorial land boundary dating from the Early Middle Ages and was once considered to link up with the Deil's Dyke.
Some deer hay winds or elricks may have consisted of banks and ditches several kilometres long that were used to direct deer for the purpose of capture and the Deil's Dyke fits this description.  "Deer hunting has left physical traces on the landscape in the form of banks and dykes used either as park boundaries or for trapping the deer".
Deil's Dyke