Before companies in America built guns, individuals who knew metallurgy, built their own guns.
Sometimes someone made the stock, another the barrel, another the lock.
Hence the phrase: Lock, Stock, and barrel... to mean complete, all that was required.