The USPS uses 5 primary different pieces of equipment to sort mail.

Advanced Facer-Cancelers
These orient mail in the appropriate direction, apply postmarks and separate mail that can be dealt with by other equipment to the appropriate other equipment.
Multiline Optical Character Readers
These read machine-printed addresses on letter mail and print a POSTNET barcode in the lower right-hand corner, as well as performing an initial sort. The OCR equipment they use is actually fairly sophisticated, and definitely very fast.
Mail Processing Barcode Sorters
These read POSTNET barcodes, first checking the lower right-hand corner and then in the address region. (And sort based on that.) These can handle something like 30,000 pieces of mail in an hour -- that's about the same rate that a WWII era machine gun could fire bullets.
Remote Barcoding System
The single most expensive piece of equipment for them to use. Basically, a human reads what the mail says and the equipment puts a POSTNET barcode on it.
Delivery Barcode Sorters and Carrier Sequence Barcode Sorters
these sort barcoded mail into the actual order the carrier takes in their route using a full 11-digit barcode (ZIP+4 code plus 2-digit delivery point)