[Solomon] was wiser than all men (I Kings 5:11), even wiser than fools (Midrash).
What does the Midrash mean by "wiser than fools"?
A man of means was once a Sabbath guest at the home of the Chofetz Chaim. He insisted upon paying the sage in advance for the Sabbath meals - an insulting demand. To everyone's surprise, the Chofetz Chaim accepted the money.
After the Sabbath the Chofetz Chaim forced the guest to take the money back. He explained, "Had I refused to accept the money before the Sabbath, the thought that he was imposing upon me might have distracted from the man's enjoying the spirit of the Sabbath. Although it was foolish of him to feel this way, I wished to put his mind at rest."
Not everyone thinks wisely all the time. Some people have foolish ideas. Yet if we oppose them, they may feel they have been wronged. Insisting on the logic of our own thinking may not convince them in the least. In such instances, it may require great wisdom to avoid offending someone, yet not submitting to his folly.
By accepting his guest's money, knowing that he would return it to him after the Sabbath, the Chofetz Chaim wisely accommodated this man's whim without compromising on his own principles.
A wise person may be convinced by a logical argument, but outsmarting a fool truly requires genius.