In ectopic pregnancy, treatment consists of removing the tissue in which the unborn baby is implanted. Unfortunately, the baby too is removed and thus, as a side effect, the baby dies.
This is very different from what is in everyday speech called an abortion.
Physically, the procedures are totally different.
Morally, the goal of an abortion is to kill the unborn child: the child itself is attacked. Removal of an ectopic pregnancy has as its goal to save the mother’s life.
Legally, the two different acts are considered entirely separately.