It's a Biblical reference. There are many sayings from Bible that have become common phrases. A 1611 English translation of the Bible, the "King James version," became deeply embedded in the culture of English speakers. Many English speakers use them without thinking of them as being religious in any way.
Job 19:20, "My bone cleaveth to my skin and to my flesh, and I am escaped with the skin of my teeth."