A scanner typically shines a very bright light at whatever you are scanning, and detects the reflected light with an array of light sensors like CCDs (Charged Coupled Device, like those found in a digital camera), converting them into electrical signals.