In the first case, the friend has given you $100 and won't see it back for a year, and then will get $5 interest.
In the second case, the friend has given the bank $100 and won't see it back for a year, and will then get $2 interest. The bank then lends you $100 which it won't see back for a year, and will then get $5 in interest.
The cases are economically the same; except in the second case, the bank takes the net interest margin of $3.
The second case, scaled up hugely, is observably what happens in the real world; it's not my theoretical construct. I refer you again to JP Morgan's balance sheet - the extent to which assets (mostly loans) exceed liabilities (mostly deposits) is simply the equity of the bank. That's the whole point of a balance sheet; it balances. If deposits exceed loans then, well, we saw what happens there, right?
You can't break half of the balance sheet off and say "look, these loans are increasing deposits at other banks; M2 has gone up"; that's literally meaningless.