Red-eye occurs when a flash is used because there is not enough light for a good exposure. Under normal conditions, in order for enough light to enter the eye, the pupil dilates. But when a flash is fired, the pupils are not expecting the bright light and do not have a chance to constrict. As a result, a large amount of light enters the eye and reflects off the blood vessels that supply the retina in the back of the eye. The redness on the pupil is actually the reflection off these blood vessels captured by the camera.
Camera lenses are similar to human eyes in that both have lenses that focus images onto a surface, but camera lenses are not flexible like an eye lens.