I do not understand how the phrase "apple of my eye" connotes affection. Where and how did this phrase originate and how can it refer to something dear?
You are right, it refers idiomatically to something that resembles an apple, that is the central part of an eye.
According to the Word Detective:
Before “apple of one’s eye” was used to mean “favorite,” it was used literally, as an anatomical term. The “apple of the eye” was the pupil, the aperture at the center of the human eye. At the time the phrase came into use, the pupil was erroneously thought to be a solid, round object, and it was called the “apple” because apples were the most commonly encountered spherical objects.
As English idioms go, “apple of one’s eye” is about as old as they get. It first appeared in print in the writings of King Aelfred way back in the ninth century, and crops up, in the modern sense of “cherished favorite,” in both the King James Bible (numerous times) and Shakespeare’s “A Midsummer Night’s Dream.”
From the Phrase Finder:
- Originally meaning the central aperture of the eye. Figuratively it is something, or more usually someone, cherished above others.
'The apple of my eye' is exceedingly old and first appears in Old English in a work attributed to King Aelfred (the Great) of Wessex, AD 885, titled Gregory's Pastoral Care.
Much later, Shakespeare used the phrase in A Midsummer Night’s Dream, 1600:
- *Flower of this purple dye, Hit with Cupid’s archery, Sink in apple of his eye
It also appears several times in the Bible; for example, in Deuteronomy 32:10 (King James Version, 1611)
- He found him in a desert land, and in the waste howling wilderness; he led him about, he instructed him, he kept him as the apple of his eye.
and in Zechariah 2:8:
- For thus saith the LORD of hosts; After the glory hath he sent me unto the nations which spoiled you: for he that toucheth you toucheth the apple of his eye.
The phrase was known from those early sources but became more widely used in the general population when Sir Walter Scott included it in the popular novel Old Mortality, 1816:
- "Poor Richard was to me as an eldest son, the apple of my eye."
Some additional notes from the wonderful world of ocular imagery:
It’s worth noting that the word “pupil” for the aperture in the eye comes from the Latin “pupilla,” meaning “little doll,” referring to the tiny reflection one sees of oneself when looking into another person’s eyes.
The same root, in the broader sense of “child,” gave us “pupil” meaning “student in school.” And when we say that we’d “give our eyeteeth” for something we desperately desire, we’re referring to our upper canine teeth, located directly under our eyes. Not only are these teeth immensely useful in eating, but damage to them can cause severe pain in one’s eyes.
"The apple of the eye" wasn't originally to do with apples, the fruit. It was a phrase meaning the pupil of the eye. So it either meant that it was something "centered" in your eye or your sight (and therefore of great importance to you) or that it was as important to you as the pretty important part of your body that allowed you to see.
In early use, the figurative version was frequently in allusion to Biblical passages including Psalm 17:8: ‘Keep me as the apple of your eye, hide me in the shadow of your wings’. OxfordWords Blog