memory
嶙峋 literally describes craggy, jutting rocks, the kind of jagged outcrops you'd see on a Chinese landscape painting. Apply that image to a body: bones poking out like rocky ridges. The metaphor is the whole point of the idiom.
history
Recorded in Gao Yunlan's 1956 novel 《小城春秋》, describing a bare-chested, emaciated child laborer carrying a basin of plaster across a swaying scaffold, locking the phrase to images of poverty and overwork.