See also first sale doctrine:
“Lending of physical books held by the library is permitted under the first sale doctrine. In other instances, such as making copies of articles and checking them out to students, libraries may rely on fair use to justify course reserves. A recent landmark case related to electronic reserves is Cambridge v. Patton, in which a group of publishers sued Georgia State University for their liberal e-reserves policy. The courts held GSU to be the prevailing party, finding fair use in the majority of alleged infringements”
See also Ben Franklin:
https://www.smithsonianmag.com/history/how-ben-franklin-invented-library-as-we-know-it-180983983/
The military had a similar problem with fitness apps for a while.
https://www.wired.com/story/strava-heat-map-military-bases-fitness-trackers-privacy/