In the UK & Ireland authors are paid for each loan of their books from libraries. For the most recent year in the UK this was 6.52 pence per loan.
For the past few years I've earned over £1000 (~$1300) each year from library loans. So no, pirating (stealing) is not like borrowing from a library.
And these earnings figures do not include the purchase of the hundreds of my books by the library system to allow these loans (including new purchases to replace damaged books).
The most recent year's 12,154 loans break down thusly:
I do have some doubts about their bookkeeping (excuse the pun) since it seems weird that Emperor of Thorns should be more borrowed than King of Thorns, and The Wheel of Osheim recorded zero paperback loans vs 769 paperback loans for The Liar's Key. But it's all good - libraries are good things and it is nice to get paid!