The word 'danger' has traveled an extraordinary semantic distance. Where a modern English speaker hears imminent peril — physical harm, risk of death — the word's medieval ancestor meant something far more specific: the jurisdictional power of a feudal lord. To be 'in danger' was to be within a lord's domain, subject to his authority, at his mercy. The journey from feudal subjection to mortal peril is one of the most striking meaning-shifts in the English lexicon.
The word enters English in the early thirteenth century from Old French 'dangier' (power, authority, dominion, jurisdiction, and later difficulty or reluctance). Old French 'dangier' derives from Vulgar Latin *dominiārium (the power or jurisdiction of a lord), built on Latin 'dominium' (sovereignty, ownership, dominion), from 'dominus' (lord, master, owner). 'Dominus' itself derives from 'domus' (house, household), which traces to PIE *dem- (to build, to construct, house).
The semantic shift happened in stages. In its earliest English appearances, 'danger' meant 'power' or 'jurisdiction' — one could be 'in the danger of' a lord, a court, or a creditor, meaning within their power. Chaucer uses 'daunger' in 'The Romance of the Rose' as a personification of resistance, standoffishness, or the power to refuse — 'Daunger' is the guardian who controls access to the beloved. From 'being in someone's power' the meaning extended to 'being in a difficult or threatening situation' and finally to the modern sense of 'exposure to possible harm
The PIE root *dem- (house, to build) has an enormous family in English. Through Latin 'domus' it gave us 'domestic' (of the household), 'domicile' (a dwelling), 'dome' (originally a house or cathedral, from Italian 'duomo'), 'domain' (a lord's territory), 'dominate' (to lord over), 'dame' and 'don' (lady and lord, from Latin 'domina' and 'dominus'). Through Greek 'demos' (the people, originally the district), the same root produced 'democracy' (rule by the people) and 'epidemic' (upon the people).
The word 'dungeon' has a parallel and intertwined history. Old French 'donjon' (the lord's tower, the keep of a castle) derives from the same Vulgar Latin *dominiōnem — the lord's stronghold. The donjon was the physical seat of the lord's power. Over time, 'donjon' narrowed in English
The biblical phrase 'in danger of hell fire' (Matthew 5:22 in the King James Version) preserves a trace of the older meaning: 'within the jurisdiction of,' 'subject to the judgment of.' This usage puzzles modern readers who read 'danger' as physical risk, but it makes perfect sense in the word's original meaning of being under an authority's power.