The story
From copper + fasten. From copper sheathing of ship hulls (to protect from damage by marine organisms. Originally copper sheathing but non-copper bolts were used, leading to corrosion. Later copper bolts (fasteners) were also used, eliminating corrosion issues. Literal sense from 18th century, metaphorical sense attested 1948.
Etymology from Wiktionary, CC BY-SA 4.0.