No one knows. The main speaker of the book is someone called Qohelet. His words are framed by a narrator who gives a brief introduction and a short epilogue.
At the start of the book, the narrator identifies Qohelet as “the son of David” and “king in Jersualem.” This could only be King Solomon, and according to tradition Qohelet is indeed Solomon. Modern scholars, however, generally regard this Solomonic authorship as a literary fiction.
What the narrator says about Qohelet in the epilogue is sparse: “Qohelet was wise and he also taught the people knowledge. Having listened and deliberated, he set in order many proverbs. Qohelet sought to find pleasing words, and he wrote words of truth honestly.” (Eccl. 12:8-10)
Qohelet is mentioned nowhere else in the Bible. Even the word itself appears only in this one book.
What matters most about Qohelet is what he says.
It means “Qohelet.” In Greek, an “ekklesia” was an assembly. So the translators who put the Hebrew scriptures into Greek some two thousand or more years ago (for the benefit of Greek-speaking Jews) rendered “Qohelet” as “Ekklesiastes.” This later became the Latin “Ecclesiastes.”
The word has nothing to do with any church. The word “ecclesia” came to be used for a church only centuries after Ecclesiastes was written.
By the way, in Hebrew both the book and its speaker are named “Qohelet.” To keep matters straight, scholars often use “Qohelet” to refer to the person, “Ecclesiastes” to the book.
How did Ecclesiastes get into the Bible?
Good question. Even Jewish rabbis have sometimes wondered how such an unusual book entered their scriptural canon. One answer is that the book was long attributed to the great and wise King Solomon. Another answer is that an epilogue wraps the book up with a pious and orthodox ending. A third answer some scholars give is that the forming of the Hebrew canon was determined not by a series of councils but by a historical process that stretched over centuries. Certain books that were a party of the literary heritage of the Hebrew people – in the words of one scholar, “a national literature upon a religious foundation” – gradually came to be thought of as scripture. And Ecclesiastes was a book of such searching thought and powerful expression that it had to be a book to keep. How it could be considered sacred was later debated, but by that time the book was already in.