Not that it makes it any better, but the billions they have are mostly imaginary. It’s not cash or even concrete numbers on a bank account. It’s just a speculative valuation of what they own and most of the value comes from stocks on a company. Stocks that only have value as long as they are desirable for someone else and there is no surplus of them on the market. They could never cash out that value and even trying to cash out a significant portion would crash the stock price and their wealth. But as long as they possess this assumed wealth, they are granted almost unlimited credit to cover any purchase.
At least in some countries authors get a compensation every time their book is borrowed from a library. So you might still be indirectly supporting the author when borrowing from a library. Also if there’s enough demand, the library may acquire additional copies and the prices for libraries are higher than for consumers.
https://equityatlas.org/how-do-authors-make-money-from-libraries/
Conversely, when you are borrowing a book from an author you like, you probably are supporting them and do not need obliged to purchase it for yourself.