The meaning of the idiom to hit the nail on the head is to describe exactly the cause of a problem or a situation.
1. The porter hit the nail on the head when he pointed out the cause of the wet baggage as a broken bottle.
2. The mechanic hit the nail on the head as soon as he opened the bonnet of the car.