You need not look too deeply to see the allegory.
When someone we love leaves us, we share the darkness that fell around Sam. We share his perspective - looking out after a lost friend, knowing we will not see them again in this world.
"(T)he evening deepened to darkness as he stood at the Haven; and as he looked at the grey sea he saw only a shadow on the waters that was soon lost in the West. There still he stood far into the night, hearing only the sigh and murmur of the waves on the shores of Middle-earth, and the sound of them sank deep into his heart."We can't see out past the waves. That's a cross we must bear in this life. We are limited to watching from the shore as long as we live, but we cannot forget that that water must end and reach another shore. If those we love leave us on a journey, then that journey must have a destination - another shore onto which they'll step.
When we forget that, we feel cheated. Frodo deserved more for all his effort than to be forced to leave his friends, didn't he? We feel cheated because we do not - cannot - yet see what Frodo sees on the opposite shore. All we have are the word of our prophets, Biblical and literary. We get a fleeting glimpse of the opposite sure through Tolkien's words, one of the most beautiful depictions of heaven I know:
"at last on a night of rain Frodo smelled a sweet fragrance on the air and heard the sound of singing that came over the water. And then it seemed to him that... the grey rain-curtain turned all to silver glass and was rolled back, and he beheld white shores and beyond them a far green country under a swift sunrise. "