from etymonline
To know (something) like the back of one's hand, implying familiarity, is first attested 1893 in a dismissive speech made to a character in Robert Louis Stevenson's "Catriona":
If I durst speak to herself, you may be certain I would never dream of trusting it to you; because I know you like the back of my hand, and all your blustering talk is that much wind to me.
The story, a sequel to "Kidnapped," has a Scottish setting and context, and the back of my hand to you was noted in the late 19th century as a Scottish expression meaning "I will have nothing to do with you" [see Longmuir's edition of Jamieson's Scottish dictionary]. In English generally, the back of (one's) hand has been used to imply contempt and rejection at least since 1300. Perhaps the connection of a menacing dismissal is what made Stevenson choose that particular anatomical reference.