A camera is a device that records images that can be stored directly, transmitted to another location, or both. These images may be still photographs or moving images such as videos or movies. The term camera comes from the word camera obscura (Latin for "dark chamber"), an early mechanism for projecting images. The modern camera evolved from the camera obscura.
How camera works?
To know this, lets look at all the parts that a camera has in it. Following figure briefly shows how light passes through different parts of camera. It is an SLR camera which is the most common and traditional equipment used in photography.
The light reflected from a object passes through a set of lenses, and onto a hinged mirror. From there it is reflected to a five sided prism called Pentaprism in such a way that what ever you see through the eye piece is exactly the same light falling onto film. The click button flips the mirror. While looking through the eye piece, the mirror is in inclined position(as shown) and as soon as one presses the click button the mirror just moves upwards so that all light falls on film and therefore the image is captured.