The term used for the “prudent” man here has both a good and bad connotation in the Old Testament. Based on the context, sometimes it’s positive – contrasted to “fools” here – and is translated accordingly.
Sometimes the term is negative – shrewd or crafty – like the serpent in the Garden of Eden (Gen 3:1)! But I think the best translation is probably my own – “street smart!” Sometimes that’s a good thing and sometimes it’s not.
Since the “prudent” and “fools” in this verse are very different people, it is not surprising that they do things quite differently. The prudent man “keeps his knowledge to himself.”
That suggests he doesn’t feel the need to say everything he knows – whether he knows little or lots. Being prudent doesn’t automatically mean someone has a high IQ. The point is that they make the decision to choose to not say everything they know.
In contrast, “the heart of fools blurts out folly.” These folks just can’t keep quiet. Not only saying everything they know, they’ll even announce everything they’re just thinking! But because of who they are, whatever they talk about will tend toward foolishness.
Understanding who it is that is talking can really help us appreciate what’s being said. We have an equivalent modern wise saying – “just consider the source!”