Nowadays, we say that someone “ha dado en el clavo” (hit the nail) when he resolvesan enigma, he gives a right answer or when he reacts correctly.
In the past, there was a game which consisted in throwing iron rings in order to center them in the nails that were in the ground. Thus, the one who managed to do it, used to win the game. Nowadays, we say that someone « ha dado en el el clavo » when he gets right.