Say your bank lends you $1000, into your bank account.
The bank's assets and liabilities balance out. The new deposit is a liability and the loan is an asset. The bank's total deposits rise by $1000. Because normal deposits count towards M2 money, and this new deposit appeared out of thin air, the M2 rises by $1000. New money has been created.
Banks do have to make sure that they meet their capital and reserve requirements, e.g. if they find themselves short they can increase their reserve by taking out a loan from the central bank.