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.