The second line is the sort of sentence that gets misused as a rule about who suffers.
Quick answer
A general pattern, stated in its simplest form: trouble tends to find the person whose life was running toward it.
Read both lines
The observation is real and ordinary. A person who deals honestly avoids whole categories of trouble that a person who does not deal honestly walks straight into, and over a lifetime the difference is visible. The second line's "instead" is a proverb's compression rather than a claim about a fixed quantity of trouble being redistributed.
What it does not mean
This cannot be read backward. A person in trouble has not been identified as wicked, and a person spared has not been certified as righteous. Job's friends ran exactly this proverb in reverse and were rebuked for it by God Himself. Proverbs describes the road's general shape; it does not audit anyone's circumstances, and using this verse to explain someone's hardship is the oldest available misuse of the book.
Related: Job 42:7 · Proverbs 11:31 · Proverbs 24:16
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.