When God created Adam, the scriptures clearly teach the meaning of soul, spirit, and body. Genesis 2:7 (KJV), “And the LORD God formed man of the dust of the ground, and breathed into his nostrils the breath of life; and man became a living soul.” Please note: Adam did not receive a soul, he became a soul.
Thus, Body + Breath of Life = Living Soul.
We may illustrate this with a light bulb. The bulb is like the body. The electricity is like the breath of life. The shining light is like the living soul. Without the bulb or the electricity, the shining light does not exist.
Similarly, without a body and without a breath of life, the soul does not exist. So, a soul does not enter a fetus. The fetus becomes a soul.
What does the Bible teach about the fetus and aborted or premature births? We need to reason on the subject because the Bible is not specific. In the Law Covenant, it reads,
“Now if people struggle with each other and strike a pregnant woman so that she gives birth prematurely, but there is no injury, the guilty person shall certainly be fined as the woman’s husband may demand of him, and he shall pay as the judges decide. But if there is any further injury, then you shall appoint as a penalty life for life, eye for eye, tooth for tooth, hand for hand, foot for foot, burn for burn, wound for wound, bruise for bruise.” – Exodus 21:22-25 (NASB20)
These scriptures speak about an injury, but are not specific respecting who is injured. It might apply to an injury to the woman or to the child. If it does apply to the child and the child dies, then strict justice means “a life for a life.”
There are also some additional indirect scriptures in Job 3:11, 13, 15-16 (NASB20), 11 “Why did I (Job) not die at birth, Come out of the womb and pass away?…13 “For now I would have lain down and been quiet; I would have slept then, I would have been at rest,…15-16 “Or with rulers who had gold, Who were filling their houses with silver. Or like a miscarriage which is hidden, I would not exist, As infants that never saw light.”
In these verses, Job is wishing he had never been born. Then he could be in the grave with all the dead, including those miscarried, and those who were stillborn. Since Job believed he would be resurrected (See Job 19:25-26) with all of mankind, his desire to have died as an unborn human being seems to indicate that those fetuses will also be resurrected.
Consequently, it seems reasonable that at some point, while in the womb, a fetus becomes a soul. However, we are not dogmatic about when this occurs.