They order it from the Fed. Each $20 FRN costs them $20.
Its borrowed from the Federal Reserve Bank.
They buy it from the Fed, they don't borrow it. They use their reserve account to pay for it.
Meeting the Variable Demand for Cash
The public typically obtains its cash from banks by withdrawing cash from automated teller machines (ATMs) or by cashing checks. The amount of cash that the public holds varies seasonally, by the day of the month, and even by the day of the week. For example, people demand a large amount of cash for shopping and vacations during the year-end holiday season. Also, people typically withdraw cash at ATMs over the weekend, so there is more cash in circulation on Monday than on Friday.
To meet the demands of their customers, banks get cash from Federal Reserve Banks. Most medium- and large-sized banks maintain reserve accounts at one of the 12 regional Federal Reserve Banks, and they pay for the cash they get from the Fed by having those accounts debited. Some smaller banks maintain their required reserves at larger, "correspondent," banks. The smaller banks get cash through the correspondent banks, which charge a fee for the service. The larger banks get currency from the Fed and pass it on to the smaller banks.
You are making the classic mistake of confusing currency with money. Only approximately 8.3% of the U.S. money supply, its liquidity, is in the form of paper currency and coinage. Currency and coin are a small subset of money. The rest exist in magnetic or optical or electronic storage methods . . . or even paper entries on books as accounting balances. Even those forms of money have been, at some point, lent into existence as a consequence of the reserve system of banking which allows banks to create money over the amount they actually have on deposit. They are required to maintain a reserve of liquid money on hand to meet cash demand for depositors needs but some of that can be electronic these days which can be wired or issued as a cashiers check in digital, non-cash form. For flexibility, they can also reach out to a pooled cash reserve account at either the Federal Reserve Bank, or an adjunct bank.