Every living thing has a spirit, as far as I can tell.

Animals definitely have spirits. They astral project, and survive death. I've seen these things many times.

A soul can be said to be the repository of its life experience. And this can be said to come into being once a living being outgrows the fascination and immersion into material existence and starts to look within, and beyond life's normal boundaries.

I think that before a being's soul comes into existence, it is recycled after life to provide sparks for new living beings.

I do not know where spirits or souls come from in the sense of what you ask.

But the universe is vast beyond imagining...

robert