From Origins A Short Etymological Dictionary of Modern English:

pupil pupa has dim pupillus (m), pupilla (f), which in L Law, came to designate a child, esp an orphan child, in the charge of a guardian or of a tutor, whence the sense "young scholar": whence MF-F pupille, orig in the L legal sense: whence E pupil. The L derivative adj pupillaris yeilds pupillary. L pupilla also denoted the pupil of the eye, "so named because of the tiny image reflected there" (E & M)