When one takes a photograph using a film type camera the light reflected off of the object being photographed is burned onto the film inside the camera. The lens and aperture precisely control this light so that the film can properly gradient the reflection of the image.
A digital camera works much the same way except that once the reflected image is captured on to hardware as opposed to a piece of film that image must be translated into a coded format. As with all digital information, it is stored as a series of zeros and ones. The structure of these determines the specific code being used. What makes this interesting is that the various digital camera manufacturers choose not to standardize their coding and each brand of high-end digital camera saves files in its own RAW files format, which makes the process to recover digital photos lost in a camera especially challenging.