Zec. 2:8 For thus said the LORD of hosts (after his glory sent me) regarding the nations that plundered you: Truly, one who touches you touches the apple of my eye.
In each case, the phrase “apple of the eye” represents something very precious, something to be guarded carefully, and in the Zechariah quote, there is the suggestion that touching it would be very painful.
After a little research on the internet, I learned the following from “The Dictionary of Clichés” by James Rogers (Ballantine Books, New York, 1985): In old English the eye's pupil was known as the apple because it was thought to be spherical and solid. Since the pupil is a crucial and indispensable portion of the eye, it serves as a symbol of something to be cherished.
Also from the “Encyclopedia of Word and Phrase Origins” by Robert Hendrickson (Facts on File, New York, 1997), we find: 'Pupillam,' or pupil, is actually the Latin for the 'apple' of the phrase, but English translations of the Bible used 'apple' because this was the early word for the pupil of the eye, which was thought to be a solid apple-shaped body. Because it is so essential to sight, the eye's apple, or pupil, is to be cherished and protected and 'the apple of one's eye' came to mean anything extremely precious.
From the same source we are told, The literal translation of the Hebrew phrase, incidentally, is 'You are as the little man in the eye' (one's own reflection in the pupil of another's eye).” This would be the teacher to student relationship. Is that the origin of the word “pupil” for a student? I leave that to you to research.
The following is pure conjecture on my part, but could it be that the several writers of the quoted verses may have used the phrase to mean “You are as my child?” Another way of saying it would be, “You are created in my image.” How about, “You are my beloved son (or daughter) in whom I am well pleased?” That's about as precious as it can get.