It’s hard to believe but until as late as the 17th century the word apple was used to refer to all fruit including nuts! Only berries escaped the apple monopoly. Thus dates were called finger-apples and cucumbers were known as earth-apples.
And the biblical forbidden fruit, which is believed by Christians and Jews to have been an apple, was possibly wheat.
The phrase apple of one’s eye has existed in the language for many centuries. Originally it referred to the pupil of the eye, which was called the apple, presumably because of its resemblance in shape to the fruit.
Sight is precious and until recently impossible to regain if lost. And so are our nearest and dearest. At some point in time someone hit upon the similarity and the phrase took on the figurative sense of the person who someone loves most we still use.
Maria is the apple of her father’s eye, his everything.