between life and death; the brink of death
Refers to the critical state where one's life hangs in the balance, often used in dramatic or serious contexts.
彼は生死の境をさまよった。
He wandered between life and death.
事故で生死の境を経験した。
I experienced the brink of death in the accident.
Compound of 生死 (life and death) and 境 (boundary). The exact historical derivation is uncertain, but the meaning is transparent from its components.