Staking is a swap
On a subnet, staking is not a deposit. It is a trade.
Every subnet has a pool holding TAO and that subnet's alpha. When you stake TAO on a subnet, it is sold into the pool for alpha at the current price. Your position is now alpha, not TAO.
From that moment, its value in TAO moves with the subnet's price. If the price rises, your stake is worth more TAO. If it falls, it is worth less. Rewards are added in alpha on top.
Unstaking is the same trade in reverse: your alpha is sold back into the pool for TAO at the price at that time.
A small swap fee, about 0.05% by default, is taken from each trade. Staking on root is the exception: there is no pool, no swap and no fee.