If they both agree to put 0.005 btc each on the channel
Alice: 0.005 btc
Bod: 0.005 btc
That means they both have 0.005 btc + 0.005 btc = 0.01 btc on the channel. Assuming Alice went to Bob's shop for coffee and he or she paid 0.0001 btc, the money will be deducted from Alice btc to Bob Btc on the channel. Which means Alice will have 0.0049 btc as 0.0001 btc is transferred by her on the channel while Bob will have 0.0051 btc for the coffee Alice paid for and so on until anyone of them closes the channel.
I think the freeze mentioned by OP is not what you explained
You are right, there must be a pool of funds before Alice and Bob can trade on the Lightning Network. But injecting funds into the fund pool in advance does not mean freezing.
After both parties have determined the allocation of funds in the fund pool, both of them can take out their own funds at any time (this step needs to be recorded on the chain)
Hashed Time Lock Contract,This is similar to a time-limited transfer.
Through a smart contract, both parties agree that the transferor will first freeze a certain amount of money (send bitcoin to a multi-signature address),
and will be locked by the ultimate recipientthe through the H(R) of a password R .
If the recipient knows the password R within a certain period of time,
so that its H(R) adaptation (actually means that the transferor authorized the recipient to withdraw cash),
then the money is transferred to the recipient.
If the recipient does not know the password R within the agreed time,
the transfer party can retrieve the frozen funds.