Capturing a Moment
A digital camera can freeze a moment forever, capturing a scene as a picture you can keep, share, and look back on years later. Cameras are now built into nearly every phone, used billions of times a day. Pressing the button feels simple, and an image just appears. But a camera does not really see the way our eyes do. So how does it turn the light of a real scene into a digital photo?
Letting the Light In
Every camera starts with light. A scene is visible because objects reflect light, and that light carries the colors and shapes of everything in view. At the front of a camera is a lens, a curved piece of glass that gathers this light and focuses it. The lens bends the incoming light so that a sharp image of the scene is projected onto a surface deep inside the camera. That surface is where the real work happens.
The Image Sensor
In a digital camera, the surface that the light lands on is called the image sensor. The sensor is the heart of the camera. Its surface is covered with a vast grid of millions of tiny light-detecting points. Each point measures how much light is falling on it. Because the points are also arranged to detect color, the sensor records not just brightness but the colors across the whole scene, point by point.
From Light to Picture
Here is the key step: each tiny point on the sensor converts the light it receives into an electrical signal. The brighter the light, the stronger the signal. A processor inside the camera takes all these millions of signals and assembles them into a digital image, a grid of colored dots that together form the picture. That image is then saved as a file. So a photo is really a careful record of how much light, and what color, reached each point of the sensor.
Source
This article was written using information from Wikipedia.