They try to give the answer in a way to make it appear that they had guessed it. Samson saw at once that she had betrayed him. He lets them know in a speech, which was of the nature of a riddle, that he had discovered the treachery.
Related Commentaries of Judges 14:18
Judges 14:18
18 And the men of the city said unto him on the seventh day before the sun went down, What is sweeter than honey? and what is stronger than a lion? And he said unto them, If ye had not plowed with my heifer, ye had not found out my riddle.