The other half of verse 5's observation, and one of the book's most quoted lines.
Quick answer
A friend who hurts you is telling the truth. An enemy who is affectionate is not. The verse sorts by reliability, not by how it feels.
Read both lines
The word is faithful, נֶאֱמָנִים, which is the vocabulary of trustworthiness rather than of good intentions. The wounds can be relied on, meaning they correspond to something real. That is the whole claim, and it is narrower than the way the verse usually gets quoted.
The second line is the safeguard. Kisses that are deceitful have the same relationship to reality as the wounds do, only inverted: they misrepresent. So the verse is not saying that painful speech is automatically loving, which would license a great deal of cruelty. It is saying that comfort and truth are not the same measurement, and that you should ask which one you are being handed.
What it does not mean
This is not a defense for people who are simply harsh. A wound is called faithful here because it comes from a friend, and the friendship is the load-bearing word, not the wound. Someone who wounds you regularly and is not your friend does not become one by citing this verse, and a person who has been criticized into the ground by an ordinary critic is not receiving what this describes. The book puts flattery on the other side of the same line at 29:5, where a man who flatters his neighbor spreads a net for his feet, and 28:23 says the rebuker ends up with more favor than the flatterer. All three assume a relationship, and none of them is a warrant for candor without one.
Related: Proverbs 28:23 · Proverbs 29:5 · Proverbs 27:9 · Proverbs 25:12
New King James Version®, Copyright © 1982, Thomas Nelson. All rights reserved. Full copyright information. Scripture provided by API.Bible.
Go Deeper
If this verse has been used to put weight on you that it was never carrying, ask about it directly.