What is a Barcode
A barcode essentially is a way to encode information in a visual pattern that a machine can read. The combination of black and white bars (elements) represents different text characters that follow a set algorithm for that barcode type. If you change the sequence of elements you get a different text.
A barcode scanner reads this pattern of black and white that is then turned into a line of text your computer can understand.