Light generally travels in a straight line. When rays reflected from a bright subject pass through the small hole in thin material they do not scatter but cross and reform as an upside down image on a flat white surface held parallel to the surface through which the hole has been pierced.
(via wikipedia)