Give up/commend the spirit
Here’s what it means
A person died as the life-breath or spirit departed the body.
Why the Bible says it this way
An idiom is a familiar phrase whose meaning comes from the whole expression, not from reading each word by itself.
A helpful detail: This wording describes a real death, not a fainting spell.