Ecclesiastes was written by an unknown author, although some traditions suggest King Solomon as the writer. The author refers to himself as "the Teacher." His purpose in writing the book as a whole was to consider the purpose of life and the human existence.
The poetry describes the way in which God has created order and organization for all things. "There is a time for everything, and a season for every activity under heaven:" - and then the Teacher gives examples of the opposites that have been arranged by God. The point is to prove how little influence humanity has in the events of life. God has ordered the passage of time and the activities that are to take place with the different stages of a person's life, the different seasons of weather, the different types of relationships between nations. "a time to be born and a time to die, a time to plant and a time to uproot,...a time for war and a time for peace."
The unstated good news or reassurance that comes out of the poem is that God is in control. Life is not chaos - there is order and reason. Humans have little control over the changes of time, but they can strive to accept them as part of God's plan.
This is actually a well-known folk song, usually called "Turn! Turn! Turn!" because of its refrain. It was composed by the singer and political activist Pete Seeger in the 1950s. Although Seeger released the song in 1962, it was best known in a cover version by the folk-rock group The Byrds, who had a hit single with it in 1965.
The song itself, except for the refrain "Turn! Turn! Turn!" is based on the Biblical book of Ecclesiastes, part of the Old Testament. It is a prolonged meditation on the ephemeral and ultimately insignificant nature of human life. The second through fourth verses of the book run as follows:
Vanity of vanities, saith the Preacher, vanity of vanities; all is vanity.
What profit hath a man of all his labour which he taketh under the sun?
One generation passeth away, and another generation cometh: but the earth abideth for ever.
The poem is actually taken verbatim (except for the refrain) from Chapter 3 verses 1 to 8 of the King James Version of the book of Ecclesiastes, and expands on the notion that the cyclical nature of worldly life suggests that we should not become attached to the life of this world but instead put our faith in God.
Seeger, a labor and environmental activist and anti-war protester, was protesting the greed and violence of capitalism and the harm it does to the weak and vulnerable. His anti-war sentiments, articulated at the height of the Cold War, were made particularly timely in The Byrds' cover during the highly unpopular Vietnam War, and can be seen in the very last line of the song, in which he adds to the Biblical phrase "a time for peace" his own commentary "I swear it's not too late!"