Lock, Stock, and Barrel
This phrase, meaning completely or thoroughly, is another phrase referring to firearms. In this case, it refers to the three major parts of a musket, the firing mechanism or lock, the stock which rests against the shoulder, and the barrel. Like lock and load, the phrase was originally reversed, first appearing in an 1817 work by Sir Walter Scott as stock, lock, and barrel. The current sequence dates to 1842.
This sense of lock first appears in 1547 in the combination form firelock. The term probably derives from the resemblance to a lock on a door. German has similar usage for the term, the word schloss referring to both a door lock and the firing mechanism of a gun.
The word stock has several senses referring to blocks of wood used for various purposes. In 1346 the word was used to refer to the wooden cross bar of a ship's anchor. In 1474 it was used to refer to the block of wood from which a bell is hung. And in 1541 it was first used in the firearm's sense.
This sense of barrel relates to the cylindrical nature of the part. The word was first used in 1648 to refer to the metal tube of a gun.