In Old English, the pupil of the eye (the round, dark center) was called the 'apple'. It was thought that the pupil was a round object much like an apple (a piece of fruit). When you look at someone, their reflection appears in your pupil. So if someone is the 'apple of your eye', he or she is someone that you look at a lot and enjoy seeing.
2) Her granddaughter is the apple of her eye.