This analogy was built to explain why there is [sort of] life after death.
The story goes something like this: Two twins grow in the womb of a pregnant woman. They talk to each other using baby language inside their mother’s womb. One day, one of the twins says to his brother: “I heard that our lives here are short, and after that there is a big world awaiting us, full of all kinds of people, objects, sunlight, etc.” The other twin dismisses these words with contempt and responds: “What nonsense you are talking. I have never seen that world, and I have never seen anyone who had seen it. At the end of our lives here nothing awaits us.”
The analogy is obvious – it is built to emphasize how the “deniers of the afterlife” are similar to the same twin who denies life outside the womb, and then to promote the feeling of a “world after death” just as there is a “world after the womb”.
A minor mistake in this analogy can perhaps be ignored: Babies in their mother’s womb DO receive inputs from the world outside the womb. They hear voices, sometimes notice lights, and more. However, the real issue is this: We, the outside observers, already know that there is life after/outside the womb, while we have zero evidence about any “life” after death, with plenty of evidence about how our feelings and sensations arise from brain activity, which, as we know, ceases with death.
In fact, this analogy can be slightly updated so that it serves other purposes as well. For example, the first twin may tell his brother: “I heard that a world full of wars, diseases, natural disasters and hatred awaits us outside” – and he will be right of course, but is this the analogy the preacher wants to convey? He could also say: “I heard that a world full of mosques, veils, hijabs and burqas, and people speaking Arabic languages awaits us outside” – and he would also be right.
The bottom line is: Even in cases where we know nothing (which is not the case here) – it does not mean that things are as a certain preacher wants us to think they are.