MMI:

Until modern times, an infant with a dead mother would be unlikely to survive anyways. In addition she may have other young children that would be put at risk, if she died in favor of the life of the infant. Also many children died young so putting the life of a healthy adult woman who might have opportunities to have more children later is not a good choice in the calculus of survival.

Some religions actually require that the pregnancy be terminated to save the life of the mother. They do not say it is ok to abort to save the mother as an exception to the normal prohibition, they say it is required. There is no choice, the mothers life is more valuable until the child is born.