The way the banking system works is that the banks are allowed to loan out money rather than having to keep it all in their vaults.
When Person A deposits money, some of that money is lent to B, for example. But the bank is not literally taking A's money and giving it to B. A may still come and get that money if he wants it.
The money that is lent to B is new money. It is money that never existed before. That is why we say that banks are creating money.
So, the money doesn't really come from anywhere. It is created new out of thin air.
We need to differentiate between the process of creating money or wealth, and the process of just transferring the money or wealth. When someone borrows money from a bank the money gets transferred from the bank to the borrower. This is just transfer of money. The amount of money received by the borrower is exactly same as the money money given out by the bank. Thus the total amount of money with the bank plus the borrower remains unchanged. There ins no creation of money or wealth. Similarly when one individual gives away money to another there is no net creation of money.
However when a farmers grows wheat in the field he is creating wealth. The worth of the wheat grown is much more than the amount of money spent on various inputs used for farming. Thus wealth has been created. When the farmer sell the wheat he is exchanging the wealth created by him for money. This process of selling is not creating money, it is only exchanging wheat for money with total amount of wealth in form of wheat and money used for purchasing it remaining same.