These three barcode formats are called symbologies - meaning they are distinct systems with their own rules for encoding data as vertical bars and spaces. Each was designed for a specific industry context.
UPC-A (Universal Product Code - Version A) is a 12-digit numeric-only standard developed in the United States in the 1970s for North American retail checkout. Every product sold on a shelf at Walmart, Target, or a US grocery store carries a UPC-A barcode. The Uniform Code Council (now GS1 US) manages the issuance of UPC company prefixes.
EAN-13 (European Article Number - 13 digit) is the international counterpart to UPC-A, adding a 13th digit at the front (the country or flag code). A UPC-A barcode is actually a subset of EAN-13: any modern scanner that reads EAN-13 will also read UPC-A. If you sell products internationally - including on Amazon's non-US marketplaces - you need EAN-13 barcodes.
Code 128 is a flexible, high-density barcode that can encode the full ASCII character set: uppercase and lowercase letters, numbers, punctuation, and special characters. It has no fixed length limit. Code 128 is the dominant format in shipping and warehousing - FedEx, UPS, and USPS tracking barcodes are all Code 128. For internal inventory management, Code 128 is the most practical choice because you can encode meaningful alphanumeric identifiers like "SHIRT-RED-LG-2024" rather than being restricted to pure numbers.