Additionally this post will concern itself only with one dimensional barcodes (like UPC, ISBN, EAN, and the like). Two dimensional barcode symbol systems exist but they are rarely used and for good reason. In general if you don't know you need it, you probably don't.
CCD/Imager vs Laser Scanner
The first step in reading a barcode is for a light sensor in the scanner to generate a representation of the barcode itself. This can be done in basically two different ways.
Most simple gun-type scanners that are widely used are laser scanners. A vibrating laser sends out a beam as it vibrates back and forth, and a sensor reads that beam's frequency to gather a narrow line image of the barcode. Laser scanners work much better in low light conditions because laser light doesn't dissipate much over distance meaning that the scanner is limited by what the light sensor can make out size-wise. This also means that laser scanners work much better also when dealing with reflective plastic covering the barcode, or with other glare issues. There are gun-type laser barcode scanners that can read barcodes at least a foot away.
The second approach is to use what amounts to a digital camera to take an image of the barcode and then process it. These sometimes include red LEDs but the range in dark environments is not good and you are limited both by the diffusion of the light and by the sensor's ability to see small details. Imager barcode scanners are required however when doing some advanced things like 2 dimensional barcodes or the like.
In general laser scanners are preferred. They are more versatile and in my experience far more robust than CCD/Imager barcode scanners.
Once the scanner has been able to recognize a barcode and convert it to raw data, the next step is to decode the barcode and turn it into a series of numbers (and in some cases letters). Most barcodes on the market decode the barcodes themselves. Others send raw data to a computer or other device and expect that device to decode the data. In general there are three relatively common setups.
The first is to use a scanner which uses a keyboard wedge interface. This has a Y adaptor, one side goes to the keyboard, and when you scan a barcode the barcode comes in as text. These are all decoded barcode scanners. The big disadvantage is that the Y connectors are a bit fragile and so the cables do sometimes need to be replaced.
The second is to use a scanner which connects over USB and tells the computer it is a second keyboard. Such a scanner delivers the benefits of a keyboard wedge scanner but with less maintenance. These are preferred where possible and where no advanced POS keyboards are in use.
The third is to use a non-decoded (or undecoded) scanner which connects directly to a point of sale keyboard. This is the most expensive but option, but these keyboards are often very helpful in reducing space, providing multiple additional functions rolled into one (some have built in trackballs, magnetic stripe readers and the like). The keyboards here are often the main maintenance points.
I hope this general overview of barcode hardware and setups has proved useful. Let us know!