A belaying pin is a device used on traditional sailing vessels to secure lines. Their function on modern vessels has been replaced by cleats, but they are still used, particularly on square-rigged ships.
A belaying pin is a solid metal bar with a curved top portion and cylindrical bottom part. It is inserted into a hole in a wooden pinrail, which usually runs along the inside of the bulwarks as shown (although free-standing pinrails are also used). Although the belaying pin can be lifted out and removed, it is usually left in place.
To secure a line, it is first led around the bottom of the pin and then the top, to form a complete turn. It is taken once more around the bottom of the pin, and then three cross-shaped turns are applied by looping the line round alternate sides of the top and bottom. This pattern can be remembered as "one hug and three kisses". Other arrangements are possible, but ensuring that the same pattern is used on a particular ship means that sailors know what to expect when releasing a line fastened by someone else - possibly in the dark.
Once the line is secure, the belaying pin is also used to store the excess. The line should be coiled, starting from where it is secured so that the twist can be worked out of the free end. The completed coil is held next to the pin, and the short length of line between the pin and the coil is pulled through the centre, twisted once (or more if necessary to shorten it) and hooked over the top of the pin, holding the coil in place. The twist is very important as it prevents the "short length of line between the pin and the coil" becoming longer by pulling more line from the coil, eventually dumping the stored line on the deck.
Some other lines run horizontally past their pins, and it is harder to maintain the tension between stopping hauling and making fast. Generally the line is held against the pin and the rail by hand - which helps a little but not much - and the transition between hauling and securing is then made as quickly as possible. At a shout of "come up!" the hauling team instantly provide the front man with slack line, and he snaps on the first turn. Inevitably some line will be lost in this procedure.
Finally, lines under very heavy load such as topsail halyards are equipped with short stopper lines attached near their pins. These are wound round the hauling line and held, to prevent it moving once the team stop hauling to allow it to be made fast.
Lines under tension can be let out in a controlled manner by leaving the first turn on the pin to provide friction. However, the hands must be kept a safe distance back along the rope or they may be dragged around the pin too.