The booking references go under many names, such as record locator, PNR reference, file key, and others. I believe they are actually a file address in the system but that I'm not too sure of. They are generated in a sequence although how that happens I don't know, but if two bookings were ended at the same time (which is of course not really possible as the system would process them milliseconds apart) they would have sequential locators such as ABC123 and ABC124. You might find that over a given period all bookings began with Y2, then G4, and so on.
Record Locators are handled differently by the GDSs which host other carriers, such as Sabre and Amadeus, and those which don't.
Amadeus hosts roughly 160 carriers. Some use the inhouse inventory system, SAA for example, and the Amadeus record locator and the SAA locator would be the same. Others don't use it, or use it partially, and there would therefore be 2 record locators, the GDS's one and the carrier's own. This is the case with BA, for example.
SABRE works similarly.
Travelport (Galileo/Worldspan) does not host carriers, and their would be their own locator, plus the 'vendor locator' of the carrier itself.
Just to make it more complicated, some OLTA's such as Expedia will overlay the GDS/carrier record locator with their own reference.
Confused ........... don't worry. Most of the airline staff are too!
By the way to answer the last part there is no connection between the record locator and the 13 digit (3 + 10) ticket number. They are allocated sequentially by BSP for travel agencies, or the airlines own system for in house issues). LCCs don't issue tickets and therefore there are no ticket numbers.