The key is that the bank is "on the hook" for being able to get that money back eventually. So they don't just loan indiscriminately.