light from an external scene passes through the hole and strikes a surface inside, where it is reproduced, inverted (thus upside-down), but with color and perspective preserved. the image can be projected onto paper, and can then be traced to produce a highly accurate representation.
or these drawings by canaletto: