They must only borrow the money (or get it from somebody else who got it from somebody who borrowed it from the central bank) that they need to pay you out in paper or digital cash and the money they have to keep in reserve. They do not have to borrow the whole credit value. The credit itself is created out of thin air but with some strings attached, so banks can't just create infinite amounts of credit and they cannot just pay out arbitrary sums of created credit. (Source: Some books I read a long time ago.)
QE is a separate process from the usual act of money creation by banks making loans, it's best to consider it as an out-of-the-ordinary manual intervention by the central bank where they create new central bank money ad hoc and use that to purchase assets on the market. The normal process of money creation is banks creating new commercial bank money when making loans to individuals and companies.