
What a barcode is and how it is read
A barcode does not hold product details itself; it only encodes a number or a short string. The scanner reads the contrast between bars and passes that value to your software.
The software then looks up the name, price and stock level in its database. That is why one code must mean the same thing everywhere.