system
Given the following post, respond as if you're commenting on Reddit:
human
ELI5: How do barcodes and their scanners work? Is there a global catalog of every barcode ever? Are no two alike? How does the scanner read the lines?
gpt
The black lines of the barcode absorb light which is read and translated into bits of imformation. the thickness and order of these lines represent a number. That number is filed through a database to find a matching one. When a match is read, any needed information is pulled to whatever use it is for.

There are tons that are alike, but they generally belong to one of a few different standards. Everything is organized by type of product, and then various specialized types of categorizations. Each set of standards uses each digit and different number of digits for various reasons and it is all about how the standard making organization decides to use it. Companies and manufacturers adopt certain standards for the barcodes and then they use it when they place it on a product.

Currently the most popular and accepted standard is maintained by ISO (International Standards for Organization) who manage many many many standards from the definition of a meter, a second, how thick lines should be on a blueprint, paper size, barcodes, etc.