Quick answer
Good teaching is a water source, and its practical function is to route a person around traps they would not have seen.
Read both lines
"Law" here is torah again in its ordinary sense of teaching, this time belonging to "the wise" rather than to God, which settles what kind of law is in view. The fountain image says the supply is continuous rather than stored, and the second line names the purpose in the least abstract terms available: snares. What wisdom does in this book is mostly preventive, and the verse describes a person walking around a trap rather than escaping one. That is why the counsel keeps arriving before the danger does.
Related: Proverbs 14:27 · Proverbs 10:11 · Proverbs 6:23
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.