why is a loan an asset to the bank? because the loan earns an interest over its lifetime. this the the fixed or variable interest rate associated with the loan with time, that loan brings periodic cashflows repaying the principal and the interest
deposits are liabilities to the bank - as they are owed to depositors/customers so the $100 cash loan that the bank issues to you becomes a deposit in that same bank, and thus a liability for the bank you can move those $100 outside of the bank at any time/on short notice