The first verse appears to be talking about the return of Israel from the Babylonian captivity. After over 70 years in captivity, they are suddenly on their way back to Jerusalem and their joy is unbounded. Even the Gentile nations recognize that “the Lord has done great things for them”.
It seems that things are not going so well now for the Israelites, perhaps referring to the many hardships endured by the returnees from Babylon. The psalmist is asking the Lord to bring back the joy and prosperity of those earlier times. He is relying upon the former blessings granted by the Lord as a sign that Israel can again be blessed. As long as the sowers are diligent and trust in the Lord, they can be rewarded with a joyful spirit and a bountiful harvest.
So it can be with us. Our journey may be difficult, but with diligent work, good seed (the Word of God), and tearful dedication, “we shall come rejoicing, bringing in the sheaves”.