Psalms - Chapter 118
The End of Hallel; The End of Hallel
David says that we should give thanks to G-d, Whose kindness is everlasting. David directs this charge to the groups he defined in Psalm 115: the Jews, the Kohanim, and the G-d-fearing people of the world.
David continues that he called to G-d from the depths of despair and G-d answered him with great relief. (Literally, David said that he called to G-d from constraint and G-d answered him with wide-open expanse. The pressures made David's soul feel confined and the salvation made it expand.) David has no fear, since he knows no one can hurt him with G-d on his side. David only relies on his aides because G-d is with them, otherwise their help would be worthless. It is better to have G-d on your side than human beings, even nobility. No matter who surrounds him, David can strike them down. And enemies have indeed surrounded David. They swarmed around him like bees, but they were consumed like thorns in a fire.
David cites a verse from the Song at the Sea, to the effect that G-d is his strength, his song and his salvation. (Compare verse 14 with Exodus 15:2.) The tents of the righteous resound with the sounds of rejoicing. They proclaim that G-d's metaphorical "strong right hand" performs mighty acts.
David says that he will to tell of G-d's deeds. G-d may have punished David for his sins, but He did not permit him to perish. (This may also refer to the nation as a whole; G-d may have permitted us to be punished in exile, but He does not permit us to be destroyed.) Open the gates of righteousness, David says, so that he may enter to thank G-d. It is the gate of G-d, that only righteous may enter. (There are different opinions as to whether this refers to a gate of Jerusalem, the Temple, or perhaps it is merely a metaphor for a level of personal sanctity.)
David thanks G-d for answering and saving him. The stone that the builders initially rejected ended up being used as the cornerstone. (This is a metaphor for David himself, who was considered the least significant of Jesse's sons by his own brothers, but he ended up being anointed king.) G-d caused this to happen and it's astounding! When the people of the world see the wonders G-d will bring about, they will exclaim that it is the day G-d has made and they will rejoice.
David pleads to G-d to save us from the evil in the world, then to make us prosperous with the good. (It may mean to save us from the war of Gog and Magog and to make us prosper in the Messianic era.) Blessed are all the Jews who return from exile; they will enjoy the blessings of the rebuilt Temple. He is G-d and He illuminates things for us in the Messianic era following the darkness of exile, so bring your sacrifices to the Temple. Thank G-d and praise Him because He is good and His kindness lasts forever!
This Psalms comprises the last four sections of Hallel: Hodu Lashem Ki Tov, Min HaMeitzar, Ana Hashem and Baruch Haba. For those last two sections, the accepted practice when reciting Hallel is say each verse twice (see Mishna Sukkah 3:11 and the Talmud there, page 38a).