Libraries rely on the first sale doctrine to protect the practice of lending books (and periodicals, audio recordings, videos, etc.) without paying royalties for each loan. From the cited article (emphasis is mine):
"First sale" is the rule that allows owners to resell, lend out, or give away copyrighted goods without interference. Along with fair use, it's the most important limitation on copyright. ... Even libraries are concerned their right to lend out books bought abroad could be inhibited.