Explains Rav Kook in his siddur Olas Ri'iyah - when somebody is in the grave there are many things he "wants" [he is שואל] but can't get.
Some people are in "sheol" while still alive. Their soul yearns for so much more but their involvement with matters of the flesh prevents them from carrying out the desires of their souls. Maybe Dovid was thanking Hashem in the aforementioned pasuk in tehillim - You took my soul out of its grave and allowed it to fulfill its desires.