The story
Metaphors that arise from various uses of pins, including popping a balloon, pinning in place, and marking with a pin (such as a map position) so that something can be found quickly later. See earlier stick a pin there.
Etymology from Wiktionary, CC BY-SA 4.0.