Quick answer
Pride and shame arrive in that order, and the verse says so without explaining the mechanism. Where you find humility, you find wisdom keeping it company.
Read both lines
The first line is a sequence rather than a threat: pride shows up, and then shame does. The verse does not say who administers the shame, which is characteristic of this book's account of how consequence works. The second line supplies the contrast, and it is quietly generous. It does not say the humble earn wisdom or achieve it; it says wisdom is with them, as a companion already present. The pairing suggests why. A person who can be told something is a person who can learn something, and pride is precisely the posture that makes learning impossible.
Related: Proverbs 16:18 · Proverbs 29:23 · James 4:6
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.