Q: I never understood how a computer could just scan a few black lines.
A: a laser shoots a bar across yhe lines of a bar code and the black breaks up that line, acording to the number of spaces and width of the returning laser it tells the computer which item has been scanned,