"And the day of death than the day of one's birth" (Ecclesiastes 7:1). Rabbi Levi said: To what is the matter comparable? To two ships that were on the sea, laden with merchandise — one coming and one going. The one that was coming, they were praising it. Those who stood by them were amazed, and said: Why are you praising this one, yet you are not praising that one? They said to them: This one, which has come back, we praise, for we know that it went out in peace and came back in peace; but as for that other one, we do not know what it is destined to do. So too, when a person is born, people do not recognize his deeds; when he departs from the world, they know what his deeds were. Therefore: "And the day of death than the day of one's birth."
The Two Ships of Birth and Death in Midrash Tanchuma
Midrash Tanchuma Buber, Vayakhel 1:3
ויום המות מיום הולדו. אמר ר' לוי למה הדבר דומה לשתי ספינות שהיו בים מלאות סחורה, אחת באה ואחת הולכת, אחת שהיתה באה היו מקלסין אותה, עמדו להם מיהים, אמרו למה אתם מקלסים לזו, ואין אתם מקלסים לזו, אמרו להם לזו שבאת אנו מקלסין, כי אנו יודעים שהלכה בשלום ובאה בשלום, אבל זו אין אנו יודעים מה היא עתידה לעשות, כך כשאדם נולד, אין בני אדם מכירין מעשיו, כשנפטר מן העולם הן יודעים מה היו מעשיו, הוי ויום המות מיום הולדו.