Never made the connection but it makes perfect sense. In a shortage things are dear as they’re scarce, hence dearth. In fact one of the obsolete senses is dearness, costliness, high price. How did I miss that one? OED has the details.
Etymology: Middle English derþe , not recorded in Old English (where the expected form would be díerðu , díerð , dýrð : compare 14th cent. dierþe in Ayenb.); but corresponding formally to Old Norse dýrð with sense ‘glory’, Old Saxon diuriđa , Old High German tiurida , Middle High German tiûrde , Middle German tûrde glory, honour, value, costliness; abstract noun < West Germanic diuri , Old English díere , déore , dear adj.1: see -th suffix1.
The form derke in Gen. & Exod. (bis) and Promp. Parv. seems to be a scribal error for derþe, derðe; but its repeated occurrence is remarkable.