Who wrote most of the psalms in the Bible?

Most of the psalms are traditionally attributed to King David. In fact, at one early stage, they were all attributed to him. However, scholars say they are a genre that did not exist at the time of David.

In the form we now see, most of the psalms are believed to have been written anonymously over a period of more than two hundred years during and after the Babylonian Exile, although some contain pre-Exilic material.
According to tradition, King David gave us the Book of Psalms. Seventy-three of the 150 bear his name, and the unattributed ones are also from him (Talmud, Berakhot 9b).

Concerning those Psalms that have the names of other authors, tradition teaches that we may thank David for them too (Talmud, Bava Bathra 14b). This is because it was he who recorded them in their permanent form and in a single book. If not for King David, those Psalms would have gone lost.
See also:
King David wrote the majority of Psalms.

Answer

Most of the psalms are traditionally attributed to King David. However, scholars say they are a genre that did not exist at the time of David. In the form we now see, most of the psalms are believed to have been written anonymously over a period of more than two hundred years during and after the Babylonian Exile, although some contain pre-Exilic material.
King David wrote many of the Psalms found in the Bible.