the deepest, most frightening darkness, the kind that feels like the edge of the grave
This is poetry's word for darkness at its most extreme: not ordinary nighttime but a thick, dreadful gloom that swallows everything. It appears only in poetic books, mostly in Job, and it almost always carries a charge of menace. Where a plain word for darkness would simply say the light is gone, this word says the dark is suffocating, hostile, and frightening.
The word itself looks like it is built from two smaller Hebrew words, one meaning shadow and one meaning death, which is why centuries of Bibles rendered it shadow of death. Many modern scholars instead hear it as a single intense word for deep darkness, and read the death overtone as something the surrounding verses supply rather than the word alone. In practice the two readings sit very close together, because the darkness this word names is exactly the darkness people associate with dying.
That is why the same word slides along a range. In most places it means an overwhelming, terrifying dark: the chaos before creation, a wilderness with no path, a place so hidden that only God can see into it. In a handful of places the grave is plainly in view, and the word carries the full weight of death. The two senses below mark that difference, but they are shades of one idea, not two separate words.