“lifts me up from the gates of death.” Here the psalmist is using “gates of death” to refer to being close to death. When the psalmist thinks it might be the end for him, God rescues him from death. The concept of the gates of the grave is slightly different, and refers to the fact that when a person dies it is as if they entered a place and the gates shut after them, and they had no power to open those gates. God opens the gates of the grave by resurrection (cp. Isa. 38:10; Matt. 16:18).