When writing a short commentary on any topic, one has to be selective. I tried to present, briefly, only a few ideas which would make the reader better understand, appreciate and pray the psalms.
Your question deals with authorship of the psalms. The language of the psalms is rooted in the ancient poetry of the Hebrew people such as in the Song of Deborah (Judges 5) and the Song of Moses (Deuteronomy 32). The present Psalter is a compilation of psalms, probably from several collections and from different periods, from David's time until after the exile.
The titles are not part of the inspired text but were added by Jewish tradition to indicate something about its history. No title is assigned to 34 psalms.
The meaning in Hebrew of the word "psalm' is "song." Therefore, it's difficult to understand why 57 are designated "psalms" and 30 "songs" since although it seems "songs" are accompanied by music, "psalms" are accompanied by stringed instruments.
The association of King David's name with the psalms shows his influence was crucial, at least inasmuch as that he and his whole dynasty were the crucial elements in Israel's destiny.
During David's time, worship must have been rudimentary. His son, Solomon rebuilt the Temple and set up its functioning including the music.
It must be noted that the name David does not necessarily refer only to King David. In 2 Samuel 7, we learn that God called not just David but his descendants to a special relationship as "God's sons" so that any later king could be known as "David, son of God."
In the headings citing David, the Hebrew "le" before David could mean "of," "by," "about" or "for" David. In addition, excavations have discovered jars with "lemalek" on them meaning "belonging to the king" so this adds another possibility.
Also, they could be "collections" of psalms for or of David. David became, what we might call, the patron saint of Israel's psalms.
By the time the Hebrew text was translated into the Greek Septuagint (LXX), between the third and first centuries BC, the full meaning of many terms had already been lost.
For example, "maskil" is generally considered a didactic poem but psalms which are not didactic are designated as this also. "Song of ascents" could have several meanings: the exiles returning, the Levite priests ascending into the Temple or pilgrims "going up" to Jerusalem for major feasts.
What are assumed to be musical directions such as "selah," used 71 times in 39 psalms, may mean a lifting up of the tone or a repetition. Also, it may mean the clashing of cymbals or the fierce beating of drums for emphasis which we often hear at the end of a symphonic piece.
King David could not have written all of the psalms but he may have written some of them. But that doesn't really change anything.
What is crucial to a fuller understanding of the psalms is that they were written by a people whose whole life was covenanted to God. Although the psalms address God, they also are Torah, teachings about God's loving will and purpose, as well as humanity's need to praise God and turn to God at all times.
Some are complaints in times of suffering while others look back over God's loving handling of Israel. Some are shouts of rejoicing on occasions such as the crowning of a king or in the beauty of the holy city Jerusalem.
Some praise God with an overwhelming sense of God's grace and goodness. Some rejoice in God's gift of the Law while others stand in awe at the mystery and beauty of nature.
They are never cries for salvation but frequently, they are cries to be forgiven for having rebelled against God's loving purpose. They are cries for faith, for hope, for more awareness of God's grace. They are shouts of praise and gratitude for what God has already done and continues to do.
That, I believe, is what the psalms have been for the Church throughout the ages and what they are for Christians of every generation.