How the bank gets money to advance loan?

They accept deposit from account holders and advance the portion of the deposit as a loan.

They accept the deposit from the account holders and by keeping a portion of deposit as the ratio in RBI as cash reserve ratio (CRR) and portion keeping in the bank itself as statutory liquidity ratio (SLR), after reserving these two ratios they advance the remaining part as a loan to borrowers.