I think Stephen believed his spirit would leave him when he died. Jesus also said the same thing when he was about to die. Some scriptures imply that spirit animates the body and when you die that spirit leaves you and goes back to God from where it came. It appears to be the breath of life. When you stop breathing you will die in minutes unless you are resuscitated. The two were yielding up their life giving air which belongs to God.
These are the scriptures that come to mind:
Job 27:3 "The spirit of God is in my nostrils."
Psalms 104:29 "If you take away their spirit, they expire and back to dust they go."
Psalms 146:4 "His spirit goes out he goes back to his ground, in that day his thoughts perish."
Ecclesiastes 12:7 "Then the dust returns to the earth just as it happened to be and the spirit itself returns to the true God who gave it."
Luke 8:55 "And her spirit returned and she rose instantly."
Just exchange the word spirit with oxygen or the ability to breath.