If someone slaughters a pregnant animal and finds an 8-month fetus inside her, whether alive or dead, or finds a dead 9-month fetus, he is allowed to tear it open without doing any shechitah (slaughter), remove the blood, and then eat it. The shechitah of the mother is effective for the dead fetus as well. The blood is forbidden because eating blood is not allowed. It has to be drained before eating. The fetus is considered like a body part of the mother. It is like eating the kidneys or the liver. It's nothing to do; it's not a separate animal. Therefore, you're allowed to eat it even though it was 8 months or 9 months, or was dead inside. There's no need for shechitah. You're allowed to eat whatever's there, but, just like a regular limb of the body, you'd have to drain the blood. You can't drink blood, so it's kosher as long as you drain the blood before eating it.
But if you find a live 9-month fetus in the slaughtered animal, you have to slaughter it because a full-term fetus that's alive is considered its own animal and not part of the mother. Once the shechitah happens, it's alive, it's still moving, and therefore it becomes its own entity, and you have to shecht it. The issue of slaughtering it and its offspring on the same day would apply. So if the 9-month fetus was there after the mother was slaughtered, you're not allowed to slaughter it on the same day as its mother. This is the opinion of Rebbe Meir. He considers the live 9-month fetus to be its own independent animal, even when it was inside the womb.
But the Hachamim (Sages) disagree. Even in the situation of a live 9-month fetus, the mother's slaughter purifies it and makes it permissible. The Hachamim say that this type of fetus, a live 9-month fetus, is not considered its own independent animal, and therefore you're allowed to eat it without shechitah. But this is only on a de'oraita (Torah-level) level. They would agree that, on a derabanan (rabbinic-level) level, once the calf walks around, even though it was slaughtered while it was inside the mother, it has to have its own shechitah before you eat it, so that people won't eventually eat animals without shechitah.
Rav Shimon Shezuri says that even though it was slaughtered while it was inside the mother, it has to have its own shechitah, even if that 9-month fetus that was inside the mother's womb when the mother was slaughtered was taken out and grew up to be an 8-year-old plowing in the field. The slaughter of the mother made it permissible for eating. It could be killed in any manner and eaten, even down the line. There's no decree on a derabanan level that a fetus found in the slaughtered mother has to have its own shechitah.
We'll conclude with the situation in which we all agree that the fetus does require its own shechitah. If he didn't slaughter the mother, but they cut her open and found a live 9-month fetus inside her, you have to slaughter it because the mother wasn't slaughtered, and therefore the mother never purified this fetus to be eaten. It's not considered to be part of a mother that had shechitah, and therefore, according to everybody, it needs its own shechitah.

