Click, Click: The Ratchet in a Socket Wrench
Anyone who has tightened a bolt with an ordinary wrench knows the problem. You turn the wrench a little, lift it off, put it back, and turn again. It is slow work. A socket wrench with a ratchet solves the problem, and you can hear it working: click, click, click.
Inside the head of the tool is a gear wheel with slanted teeth. A small spring-loaded catch called a pawl rests against those teeth. When you turn the handle one way, the pawl locks into a tooth and the gear turns the socket, which grips the bolt. The bolt tightens.
Now swing the handle back. The pawl does not lock this time. The slanted teeth push the pawl aside, and it clicks over each tooth as the handle moves. The socket stays where it is, so the bolt does not loosen. Then you swing forward again and the pawl catches. You never have to lift the tool off the bolt.
Many ratchets have a small switch that flips the pawl to the other side. That lets the same tool loosen a bolt instead of tightening it. The idea of a part that moves one way but not the other appears in many places, from bicycle hubs to tie-down straps and some clocks.
The clicking is simply the sound of the pawl hopping from tooth to tooth.