As it says in Wikipedia, “It is not known when or by whom the Catrail was made, or for what purpose.” That kind of sums it up. The ditch was probably not a fortification, as it isn’t substantial enough to be effective, so it may have marked a boundary between two lost kingdoms in the early Middle Ages, but in that case you have to ask why they went to so much trouble. It is unusual in that it runs from the south towards the north-west, and then curves eastwards towards Selkirk.
It was very heavy going, walking over the spongy grass.
In some parts it is barely discernable, and in others it has disappeared altogether.
You can just about make out the path of the Catrail in the photo above, through the trees and then over the hill, towards the right.
I was using a 1974 O/S map, which didn’t have many of the recent tree plantations marked on it, and once we left the trail and went through the forest we got lost. There was some discussion about whether we were completely and utterly lost, completely lost, or merely lost.
However, after we walked across some boggy fields and back into the forest, we emerged at a track which was more-or-less exactly where I thought we should be. From there it was less than two miles back to the car.