How is it that.....

How come when a heart stops beating, that person is claimed dead?

But when a heart is beating in the womb...it isn't considered alive?

Explain?