God told King Solomon to ask for anything and it would be given to him. (I think this is the closest thing we see in the Bible to God granting wishes like a genie.)
Solomon asked for wisdom and knowledge. And God gave it to him — along with wealth and power as a bonus. The Bible later says that Solomon was wiser than anyone else who ever lived.
It is from this man — the wisest one who ever lived — that we get the book of Ecclesiastes. Go figure. If Solomon’s writing in Ecclesiastes is a showcase of wisdom and the result of knowledge, then I’ll pass.
However, we also know that Solomon was distracted by the beliefs of his many wives. They turned his attention away from God and towards other things.
So, despite being wise, Solomon became unwise and strayed from God. I wonder if the book of Ecclesiastes is a reflection of that.