This selection from Kohelet Rabbah (the classical midrashic collection on the biblical book of Kohelet, or Ecclesiastes) expands on the biblical statement that we leave this world the same way that we enter it. Among other things, this midrash emphasizes both the beauty and the impermanence of worldly pleasures and riches. This viewpoint is reflected in traditional Jewish burial customs, in which all are buried in simple shrouds and nothing else is placed in the casket. (Contrast this, for example, with the way in which ancient Egyptian kings were buried with their wealth so that it might accompany them into the next world.)
As he came forth from his mother’s womb: (Ecclesiastes 5:14). Genivah said: It is like a fox that found a vineyard, which was fenced in on all sides. There was one hole through which he wanted to enter, but he was unable to do so. What did he do? He fasted for three days until he became lean and frail, and so got through the hole.
Then he ate [of the grapes] and became fat again, so that when he wished to go out he could not pass through at all. He again fasted another three days until he became lean and frail, returning to his former condition, and went out. When he was outside, he turned his face and gazing [back] at the vineyard, said, "O vineyard, O vineyard, how good are you and the fruits inside! All that is inside is beautiful and commendable, but what [lasting] enjoyment has one from you? As one enters you so he comes out." Such is this world.
Another interpretation of As he came forth from his mother’s womb, naked shall he go back as he came: It has been taught: As a man enters [the world] so he departs. He enters it with a cry and departs from the world with a cry. He enters the world with weeping and takes leave of it with weeping. He enters the world in love and takes leave of it in love. He enters the world with a sigh and takes leave of it with a sigh. He enters the world devoid of knowledge and takes leave of it devoid of knowledge. It has been taught in the name of Rabbi Meir: When a person enters the world, his hands are clenched as though to say, "The whole world is mine, I shall inherit it"; but when he takes leave of it, his hands are spread open as though to say, "I have inherited nothing from the world." For thus said Solomon [to whom authorship of Ecclesiastes is attributed by Jewish tradition]: As he came forth from his mother’s womb, naked shall he go back as he came and shall take nothing for this labor.