That is a big question. One that only God knows the answer to.
Is IVF playing God, or did God give us the knowledge for IVF?
When does a soul enter the body?
Why are some children born to loving families regardless of economic status and others born to abusive or unloving homes
I have a whole lot of questions to ask the Almighty and I’m sure He will find my unending questions as annoying as my earthly father.
There's only one scripture that comes close to answering the soul question. In the case of Adam, God breathed a soul into him. My guess is that's the allegory referring to when we gasp that first breath upon entering the world.