A standard duplicate is made by clamping your key and a matching blank side by side in a key machine. A guide traces the original while a cutter wheel reproduces each cut on the blank. The result is only as accurate as the key being traced, the blank chosen and the calibration of the machine, which is why some hardware store copies need jiggling.
Every copy inherits the wear of the key it came from. After a few generations the cuts drift shallow and the copy stops lifting the pins to the shear line. When we see that, we measure the key, work out the original depths for that brand of lock and cut a fresh key to those numbers instead of tracing the worn one.
Some keys are not ours to copy freely. High security and patented keyways, used by brands such as Medeco, Mul-T-Lock and Schlage Primus, are sold with a control system. Blanks are restricted, and a copy calls for the authorization card or a signature from the person on record. We ask for that proof every time and will not cut the key without it.